Updated Fuel, Tags Missing

edited April 2015 in Modules
Hello. I just updated Fuel from 1.0 to 1.2.1 and now in my modules, tags display the category instead of tags. How can I fix this?
public $has_many = array('tags' => array(FUEL_FOLDER => 'fuel_tags_model', 'where' => 'category_id = 1')); // Keys are model, which can be a key value pair with the key being the module and the value being the model, module (if not specified in model parameter), relationships_model, foreign_key, candidate_key.

Comments

  • edited 6:45PM
    I believe this has been fixed in the develop branch:
    https://github.com/daylightstudio/FUEL-CMS/tree/develop
  • edited April 2015
    Alright, I uploaded that version instead. Now when I try to save, I get several errors:

    <div id="error_php" style="width: 500px; margin: auto; border: 1px solid #ddd; padding: 20px;"> <h1 style="margin: 0; padding:0; font-family: Arial,Helvetica,sans-serif; font-size: 22px; color: #999; font-weight: normal; padding: 10px 4px 5px 0;">A PHP Error was encountered</h1> <p>Severity: Warning</p> <p>Message: include(/home/user/public_html/fuel/application/config/editors.php): failed to open stream: No such file or directory</p> <p>Filename: libraries/Fuel_custom_fields.php</p> <p>Line Number: 130</p> </div><div id="error_php" style="width: 500px; margin: auto; border: 1px solid #ddd; padding: 20px;"> <h1 style="margin: 0; padding:0; font-family: Arial,Helvetica,sans-serif; font-size: 22px; color: #999; font-weight: normal; padding: 10px 4px 5px 0;">A PHP Error was encountered</h1> <p>Severity: Warning</p> <p>Message: include(): Failed opening '/home/user/public_html/fuel/application/config/editors.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php')</p> <p>Filename: libraries/Fuel_custom_fields.php</p> <p>Line Number: 130</p> </div><div id="error_php" style="width: 500px; margin: auto; border: 1px solid #ddd; padding: 20px;"> <h1 style="margin: 0; padding:0; font-family: Arial,Helvetica,sans-serif; font-size: 22px; color: #999; font-weight: normal; padding: 10px 4px 5px 0;">A PHP Error was encountered</h1> <p>Severity: Notice</p> <p>Message: Undefined variable: config</p> <p>Filename: libraries/Fuel_custom_fields.php</p> <p>Line Number: 131</p> </div><div id="error_php" style="width: 500px; margin: auto; border: 1px solid #ddd; padding: 20px;"> <h1 style="margin: 0; padding:0; font-family: Arial,Helvetica,sans-serif; font-size: 22px; color: #999; font-weight: normal; padding: 10px 4px 5px 0;">A PHP Error was encountered</h1> <p>Severity: Notice</p> <p>Message: Undefined variable: config</p> <p>Filename: libraries/Fuel_custom_fields.php</p> <p>Line Number: 132</p> </div><div id="error_php" style="width: 500px; margin: auto; border: 1px solid #ddd; padding: 20px;"> <h1 style="margin: 0; padding:0; font-family: Arial,Helvetica,sans-serif; font-size: 22px; color: #999; font-weight: normal; padding: 10px 4px 5px 0;">A PHP Error was encountered</h1> <p>Severity: Warning</p> <p>Message: include(/home/user/public_html/fuel/application/config/editors.php): failed to open stream: No such file or directory</p> <p>Filename: libraries/Fuel_custom_fields.php</p> <p>Line Number: 130</p> </div><div id="error_php" style="width: 500px; margin: auto; border: 1px solid #ddd; padding: 20px;"> <h1 style="margin: 0; padding:0; font-family: Arial,Helvetica,sans-serif; font-size: 22px; color: #999; font-weight: normal; padding: 10px 4px 5px 0;">A PHP Error was encountered</h1> <p>Severity: Warning</p> <p>Message: include(): Failed opening '/home/user/public_html/fuel/application/config/editors.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php')</p> <p>Filename: libraries/Fuel_custom_fields.php</p> <p>Line Number: 130</p> </div><div id="error_php" style="width: 500px; margin: auto; border: 1px solid #ddd; padding: 20px;"> <h1 style="margin: 0; padding:0; font-family: Arial,Helvetica,sans-serif; font-size: 22px; color: #999; font-weight: normal; padding: 10px 4px 5px 0;">A PHP Error was encountered</h1> <p>Severity: Notice</p> <p>Message: Undefined variable: config</p> <p>Filename: libraries/Fuel_custom_fields.php</p> <p>Line Number: 131</p> </div><div id="error_php" style="width: 500px; margin: auto; border: 1px solid #ddd; padding: 20px;"> <h1 style="margin: 0; padding:0; font-family: Arial,Helvetica,sans-serif; font-size: 22px; color: #999; font-weight: normal; padding: 10px 4px 5px 0;">A PHP Error was encountered</h1> <p>Severity: Notice</p> <p>Message: Undefined variable: config</p> <p>Filename: libraries/Fuel_custom_fields.php</p> <p>Line Number: 132</p> </div><div id="error_php" style="width: 500px; margin: auto; border: 1px solid #ddd; padding: 20px;"> <h1 style="margin: 0; padding:0; font-family: Arial,Helvetica,sans-serif; font-size: 22px; color: #999; font-weight: normal; padding: 10px 4px 5px 0;">A PHP Error was encountered</h1> <p>Severity: Warning</p> <p>Message: Cannot modify header information - headers already sent by (output started at /home/user/public_html/fuel/codeigniter/core/Exceptions.php:185)</p> <p>Filename: libraries/Session.php</p> <p>Line Number: 688</p> </div><div id="error_php" style="width: 500px; margin: auto; border: 1px solid #ddd; padding: 20px;"> <h1 style="margin: 0; padding:0; font-family: Arial,Helvetica,sans-serif; font-size: 22px; color: #999; font-weight: normal; padding: 10px 4px 5px 0;">A PHP Error was encountered</h1> <p>Severity: Warning</p> <p>Message: Cannot modify header information - headers already sent by (output started at /home/user/public_html/fuel/codeigniter/core/Exceptions.php:185)</p> <p>Filename: helpers/MY_url_helper.php</p> <p>Line Number: 397</p> </div>
  • edited 6:45PM
    There is a fuel/application/config/editors.php file that should exist in your config folder that seems like it may be missing according to that error.
  • edited 6:45PM
    Thanks. When I did the upgrade, I only replaced the fuel/modules/fuel folder. I went through fuel/application and added the missing files. It works now, but should I replace any other directories, fuel/codeigniter for example?
  • edited 6:45PM
    There have been some minor changes to the MY_fuel.php file but I think that should be about it and you may not need to update that on your end.
  • edited April 2015
    I had some issues related to tags - in my faqs module the tags combo had categories instead of tags. So I updated to the develop branch too, which fixed the admin issues, but I noticed in passing the following in the tags guide here, the docs example needs to specify
    $has_many = array('tags' => array(FUEL_FOLDER => 'fuel_tags_model')); instead of: $has_many = array('tags' => 'fuel_tags_model');
    otherwise the fuel_tags_model can't be found, and no tags property exists from fuel_model()

    Incidentally, using the example on that page, should there be duplicate tags (where many faqs, for example, have the same tag)? Eg
    $widgets = fuel_model('faqs'); foreach($widgets as $widget) { $widget_tags = $widget->tags; foreach($widget_tags as $tag) { echo $tag->name; } }
    I can't recall if these were distinct in the past?
  • edited April 2015
    Mmmh - I've deleted all tags & categories from their tables, and now in the admin I just get the ajax loading spinner when viewing the list page for tags or categories....

    And now my home page shows PHP error:
    Cannot redeclare class MY_Security_Policy in ...\fuel\modules\fuel\libraries\MY_Parser.php on line 383

    When I updated to the develop branch, I just copied the fuel module over and added the editors.php to application/config - I think there might be some other stuff missing or wrong?
  • edited 6:45PM
    MY_Parser files doesn't exist anymore. Also, there are some database updates that are in the fuel/install/upgrades/fuel_1.3_schema_changes.sql
  • edited May 2015
    I deleted MY_Parser and that removed the PHP error, and added the extra SQL, but I've noticed a couple of other issues.

    I realise the development branch might not be ready, AND I'm upgrading an existing v1.2 installation, but here's what I've found:

    1) js on module create / edit pages generates an error (where an editor is used) "fuel.fields.setElementData is not a function" (this is from an inline script in the head. I'm using CKeditor, and it seems editor related?) It has knock on effects (perhaps?) eg linked fields (eg slugs) no longer update as the source field is typed.

    2) $config['ck_editor_settings'] seems to be ignored now - in fact, all cke settings seem absent from v1.3 MY_Fuel and Fuel configs? CKE still works, but with the default toolbars. [have just realised this config is now in editors.php]

    3) [minor] $tag = $this->fuel->tags->find_by_tag('my tag'); This works only with the slug value, not the "name" field - eg tags with spaces aren't found. That isn't clear in the documentation.

    I think I just need the files to fix the tags / categories combo issue (which seems like the Fuel_tags & Fuel_tags_model files)!
  • edited 6:45PM
    Is it possible that some of the files in the fuel/modules/fuel folder didn't get updated. The fuel.fields.setElementData should be in the custom_fields.js file:
    https://github.com/daylightstudio/FUEL-CMS/blob/develop/fuel/modules/fuel/assets/js/fuel/custom_fields.js

    Regarding #3, I'll add that in the comment that it is specific to the slug value.
  • edited 6:45PM
    I think I deleted the Fuel folder and added the develop one afresh. However, I've since reverted to v1.2 and used just the Tag library and model to fix the category issue (which it has).

    Seems like v1.3 is a bigger step than most? I look forward to it.
Sign In or Register to comment.