Note the upgraded forum! If you are experiencing issues logging in, you may need to reset your password which should send an email. If the email doesn't arrive, be sure to check your spam folder just in case.

Categories module override

edited December 2014 in News & Announcements
I recently updated from v0.9.3 to v1.2.1.
I previously had a simple module called "categories" (DB name also "categories"), file and class called "categories_model". It seems categories is now part of FUEL and you need to do a module override. I am having trouble overriding the default categories module with my custom categories module.

I added the following in MY_fuel_modules - $config['module_overwrites']['categories'] = array('hidden' => TRUE, 'model_name' => 'Categories_model', 'model_location' => 'models');

But i'm getting various PHP errors regarding undefined indexes e.g.:

A PHP Error was encountered
Severity: Notice
Message: Undefined index: slug
Filename: libraries/Data_table.php
Line Number: 222

A PHP Error was encountered
Severity: Notice
Message: Undefined index: context
Filename: libraries/Data_table.php
Line Number: 222

What do I need to do to use my simple module?

Thanks.

Comments

  • edited 12:15PM
    I think you may need to overwrite the table_headers fields and use your own (not necessarily those that are below):
    $config['module_overwrites']['categories']['hidden'] = TRUE; $config['module_overwrites']['categories']['model_location'] = 'app'; $config['module_overwrites']['categories']['model_name'] = 'categories_model'; $config['module_overwrites']['categories']['table_headers'] = array( 'id', 'name', 'slug', 'precedence', 'published', );
  • edited 12:15PM
    Thanks, working.
Sign In or Register to comment.