It looks like you're new here. If you want to get involved, click one of these buttons!
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
https://github.com/daylightstudio/FUEL-CMS/tree/develop
<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>
$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?
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?
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)!
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.
Seems like v1.3 is a bigger step than most? I look forward to it.