Problem to display fields in a customizd module after update

More
12 years 9 months ago #22790 by vlester
Hello,

I had customized the YooCarousel module to display several Flexicontent fields and all worked well until I update Flefixontent with the new version ( FLEXIContent - 1.5.6 - RC3 r1151). It seems like the code I used to display fields doesn't work anymore :
$row->fields ->display

I have this error now :
undefined property: stdclass::$display $row->fields

Here is the last part of my code where the problem seems to be:
Code:
$db->setQuery( $query, 0, $count ); $rows = $db->loadObjectList(); $rows = FlexicontentFields::getFields($rows, 'module'); $i = 0; $lists = array(); foreach ( $rows as $row ) { if($row->access <= $aid) { $lists[$i]->link = JRoute::_(FlexicontentHelperRoute::getItemRoute($row->id, $row->catid, $row->sectionid)); } else { $lists[$i]->link = JRoute::_('index.php?option=com_user&view=login'); } $lists[$i]->title = htmlspecialchars( $row->title ); $lists[$i]->date->display = $row->fields ['date']->display; $lists[$i]->evenement = $row->fields ['evenement']->display; $lists[$i]->imageevent = $row->fields ['imageevent']->display; $lists[$i]->titrefilm1 = $row->fields ['titrefilm1']->display; $i++; } return $lists;

I also tried to modify with this but without success :
Code:
$rows = FlexicontentFields::getFields($rows, 'module', $params);

Thanks for your help

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #22793 by ggppdk
In v1.5.6 --for performance reasons-- fields are not rendered unless they are in a template position, the module is a special case and since it has no positions, it must pass the fields to render via the $params object:
Code:
// Fields to render $fields_list="date,evenement,imageevent,titrefilm1"; // Set fields to render into parameters $params->set('fields',$fields_list); // Render the fields (create their "display" variable) $rows = FlexicontentFields::getFields($rows, 'module', $params);


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #22796 by vlester
Hello,

Thanks for your reply.

I've tried what you said but it still doesn't work. Should I change something else ?
Code:
// Fields to render $fields_list="date,evenement,imageevent,titrefilm1"; // Set fields to render into parameters $params->set('fields',$fields_list); // Render the fields (create their "display" variable) $rows = FlexicontentFields::getFields($rows, 'module', $params); $i = 0; $lists = array(); foreach ( $rows as $row ) { if($row->access <= $aid) { $lists[$i]->link = JRoute::_(FlexicontentHelperRoute::getItemRoute($row->id, $row->catid, $row->sectionid)); } else { $lists[$i]->link = JRoute::_('index.php?option=com_user&view=login'); } $lists[$i]->title = htmlspecialchars( $row->title ); $lists[$i]->date = $row->fields ['date']->display; $lists[$i]->evenement = $row->fields ['evenement']->display; $lists[$i]->imageevent = $row->fields ['imageevent']->display; $lists[$i]->titrefilm1 = $row->fields ['titrefilm1']->display; $i++; }


Thanks again

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #22797 by ggppdk
Put these lines, just after the starting <?php in file:
administrator/components/com_flexicontent/defineconstants.php
Code:
error_reporting(E_ALL); ini_set('display_errors',1);
Hopefully some warning messages, will get printed.


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #22798 by vlester
Thanks

Indeed, there are a lot of errors.
Code:
Notice: Trying to get property of non-object in www/components/com_flexicontent/classes/flexicontent.fields.php on line 511 Notice: Trying to get property of non-object in www/components/com_flexicontent/classes/flexicontent.fields.php on line 538 Notice: Trying to get property of non-object in www/components/com_flexicontent/classes/flexicontent.fields.php on line 563 Notice: Trying to get property of non-object in www/components/com_flexicontent/classes/flexicontent.fields.php on line 586 Notice: Trying to get property of non-object in www/components/com_flexicontent/classes/flexicontent.fields.php on line 612 Notice: Trying to get property of non-object in www/components/com_flexicontent/classes/flexicontent.fields.php on line 635 Notice: Trying to get property of non-object in www/components/com_flexicontent/classes/flexicontent.fields.php on line 658 Notice: Trying to get property of non-object in www/components/com_flexicontent/classes/flexicontent.fields.php on line 681 Notice: Trying to get property of non-object in www/components/com_flexicontent/classes/flexicontent.fields.php on line 67 Notice: Trying to get property of non-object in www/components/com_flexicontent/classes/flexicontent.fields.php on line 68 Notice: Trying to get property of non-object in www/components/com_flexicontent/classes/flexicontent.fields.php on line 69 Notice: Trying to get property of non-object in www/components/com_flexicontent/classes/flexicontent.fields.php on line 70 Notice: Trying to get property of non-object in www/components/com_flexicontent/classes/flexicontent.fields.php on line 71 Notice: Trying to get property of non-object in www/components/com_flexicontent/classes/flexicontent.fields.php on line 72 Notice: Undefined property: stdClass::$hits in www/components/com_flexicontent/classes/flexicontent.fields.php on line 98 Notice: Undefined property: stdClass::$sectionid in www/components/com_flexicontent/classes/flexicontent.fields.php on line 141 Notice: Undefined property: stdClass::$access in www/modules/mod_yoo_carousel/helper.php on line 215 Notice: Undefined property: stdClass::$id in www/modules/mod_yoo_carousel/helper.php on line 217 Notice: Undefined property: stdClass::$catid in www/modules/mod_yoo_carousel/helper.php on line 217 Notice: Undefined property: stdClass::$sectionid in www/modules/mod_yoo_carousel/helper.php on line 217 Notice: Undefined property: stdClass::$title in www/modules/mod_yoo_carousel/helper.php on line 221 Notice: Undefined property: stdClass::$fields in www/modules/mod_yoo_carousel/helper.php on line 224 Notice: Trying to get property of non-object in www/modules/mod_yoo_carousel/helper.php on line 224 Notice: Undefined property: stdClass::$fields in www/modules/mod_yoo_carousel/helper.php on line 225 Notice: Trying to get property of non-object in www/modules/mod_yoo_carousel/helper.php on line 225 Notice: Undefined property: stdClass::$fields in www/modules/mod_yoo_carousel/helper.php on line 226 Notice: Trying to get property of non-object in www/modules/mod_yoo_carousel/helper.php on line 226 Notice: Undefined property: stdClass::$fields in www/modules/mod_yoo_carousel/helper.php on line 227 Notice: Trying to get property of non-object in www/modules/mod_yoo_carousel/helper.php on line 227 Notice: Undefined property: stdClass::$introtext in www/modules/mod_yoo_carousel/helper.php on line 27 Notice: Undefined property: stdClass::$fulltext in www/modules/mod_yoo_carousel/helper.php on line 29

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #22809 by ggppdk
These messages mean that what you are passing to getFields() function is not valid, there is no $rows->id, maybe your sql query is broken.

try doing:
Code:
$rows = $db->loadObjectList(); if ( $db->getErrorNum() ) { $jAp=& JFactory::getApplication(); $jAp->enqueueMessage( nl2br( $query."\n" .$db->getErrorMsg() ."\n"),'error'); }

Also try:
Code:
echo "<pre>"; print_r($rows);
OR
Code:
echo "<pre>"; print_r($rows[0]);

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.520 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline