Does anyone have suggestions for improving performance when using Marc’s extensions? We’re using checkbox, file, and multi-relationship (all updated to the latest versions.) It appears that EE loops through the class/method for each extension for each entry in the weblog being displayed (see snippet below).
Is this normal behavior for these extensions? Is there a way to improve performance? (Beyond caching, disable, etc. I’ve gone through the KB and forum posting optimization suggestions already.) Any suggestions for mods to the extensions to remedy this behavior?
Thanks,
David
(0.580615) Calling Extension Class/Method: Checkbox/modify_template
(0.620562) Calling Extension Class/Method: Mh_file_ext/modify_template
(0.643547) Calling Extension Class/Method: Multi_relationship/modify_template
(0.658232) Calling Extension Class/Method: Checkbox/modify_template
(0.658911) Calling Extension Class/Method: Mh_file_ext/modify_template
(0.819173) Calling Extension Class/Method: Multi_relationship/modify_template
(0.830039) Calling Extension Class/Method: Checkbox/modify_template
(0.900561) Calling Extension Class/Method: Mh_file_ext/modify_template
(0.913831) Calling Extension Class/Method: Multi_relationship/modify_template
(0.924747) Calling Extension Class/Method: Checkbox/modify_template
(0.925430) Calling Extension Class/Method: Mh_file_ext/modify_template
(1.000017) Calling Extension Class/Method: Multi_relationship/modify_template
Here’s one way to get the count during a related_entries loop: (requires PHP parsing enabled on output)
<?php $re_count = 1; ?>
{related_entries id="my_related_entries"}
re_count: <?php echo $re_count; ?>
<?php $re_count ++; ?>
{/related_entries}
This also works if you need to add the count to an embed tag:
{embed="my_group/my_template" re_count="<?php echo $re_count; ?>"}
Here’s one way to get the count during a related_entries loop: (requires PHP parsing enabled on output)This also works if you need to add the count to an embed tag:<?php $re_count = 1; ?> {related_entries id="my_related_entries"} re_count: <?php echo $re_count; ?> <?php $re_count ++; ?> {/related_entries}
{embed="my_group/my_template" re_count="<?php echo $re_count; ?>"}
Excellent! I need a way to keep track of methods of improving and working around extensions etc…
As far as I can see this extension (v 1.0.6) is not MSM safe :( However I have tweaked the following lines and it seems ok now: Line 457:Line 467:global $DB, $FNS, $PREFS, $TMPL, $EXT, /*$all_fields,*/ $Weblog;
Line 469:if(!isset($$reference->cfields[$PREFS->ini('site_id')])) continue;
Hopefully Mark can add this to the source for the next release$field_id = $$reference->cfields[$PREFS->ini('site_id')][$rel_data['field_name']];
Heya, I’m trying to get this to work on MSM. Unfortunately the suggestion above did not help. When I enable the plugin, before or after modifying the code as suggested I cannot access my global custom field groups. It doesn’t load the preferences for any of them. Any ideas?
I’m on EngineHosting and running PHP 5.1 and I’m getting the {REL[12][courses-images]nFCQ8K3dREL}{REL[13][courses-images]…. junk code.
I’ve tried the fix mentioned earlier in the thread and used:
if (isset($EXT->extensions['weblog_entries_tagdata']))
{
// -- PHP4 Fix For call_user_func_array not passing by reference
global $Weblog; $Weblog = $this;
// -- End Fix
$tagdata = $EXT->call_extension('weblog_entries_tagdata', $tagdata, $row, $this);
if ($EXT->end_script === TRUE) return $tagdata;
// -- PHP4 Fix For call_user_func_array not passing by reference
$this = $Weblog; unset($Weblog);
// -- End Fix
}
in place of:
if ($EXT->active_hook('weblog_entries_tagdata') === TRUE)
{
$tagdata = $EXT->call_extension('weblog_entries_tagdata', $tagdata, $row, $this);
if ($EXT->end_script === TRUE) return $tagdata;
}
After a quick refresh, the multi relationship works like a charm and multiple images (weblog not gallery) show up from the relationship and the REL code goes away and everything is seemingly fine.
However, when I refresh the page or try to navigate to another page, I get this error message:
Fatal error: Cannot re-assign $this in /www/eh6420/public_html/kygolfing/system_folder/modules/weblog/mod.weblog.php on line 3159
Any ideas on this one?
I’ve still been messing with this extension trying to get it to work and am making little progress. I’ve deleted and reinstalled the extension and tried it and it gave me the REL junk code, so I applied the fix at the top of the file and it gives me the same fatel error that I posted above.
I have noticed however that without the fix, it does work sporadically. Usually the first time I visit the entry with the relationship it works no problems. If I refresh the page, it breaks and displays the REL code. IF I refresh 5-10 more times, it will work again and then after another refresh it’s broken again. Seems weird?
Anyone else getting this or should I just disable the extension and move on with my life? 😉
Here is the URL: http://www.kentuckygolfing.com/courses/details/gibson-bay-golf-course/ (the images of the course is the multi-relationship)
should work the first time you visit and then after a refresh, it breaks. I’m guessing that others in this thread are possibly thinking that they’ve fixed the problem but if they don’t refresh, they likely will never see the extension break. As long as my visitors don’t refresh the page, I should be fine. 😊
Just an update. This problem has been solved it seems. I contacted EngineHosting just to verify that I was in fact running PHP 5.x + and they confirmed that they were in the middle of a migration and I was on one of their clusters they were migrating from php4 to php5 and they went ahead and moved me over to php5 and it seems now that the issues I was having with this extension have been solved. I’ve refreshed numerous times and I don’t seem to be getting the [REL] junk anymore.
So, thanks Mark for this extension! Just what I needed. 😊
I am using multi Relation for a project - thanks Mark it has solved a few problems for me. I have noticed that this is pulling in entries that whose status is closed - so I tried adding the parameter status=”open” but I get a load of errors lines appearing on the page.
{exp:weblog:entries weblog="special_occasions"}
<h2>{title}</h2>
<strong>{expiration_date format="%D, %F %d, %Y"}</strong>
{special_occasions_text}
{related_entries id="special_occasions_items" status="open"}
<ul>
<li>{title}</li>
</ul>
{/related_entries}
{/exp:weblog:entries}
I get these errors on the rendered page: <pre><code>Notice: Undefined index: special_occasions_items” status=”open in /www/example_site/public_html/cms/extensions/ext.multi_relationship.php on line 471
Notice: Undefined index: field_id_ in /www/example_site/public_html/cms/extensions/ext.multi_relationship.php on line 478</code></pre>
If I take status=”open” out everything is OK other than I am showing closed entries. Anyone have any ideas what I have done wrong?
This site is on EE 1.6.3, using MSM and on Engine Hosting (so PHP 5 I think).
I’m having the same problem as ISO and JCI.
I’m using Multiple Site Manager with EE 1.6.3.
When I first enabled the plugin, all the related entries stopped displaying on all my pages. I then applied the fix suggested by Leevi Graham. All my related entries are now displaying EXCEPT for the relationships set up with the multi-relationship field.
I tried adding the site name to the code in case it needed that, but this hasn’t helped either.
{exp:weblog:entries weblog="sa_topic" status="open" site="mac"}
{related_entries id="satopic_related"}
<a href="http://{title_permalink">{title}</a>
{/related_entries}
{/exp:weblog:entries}
Has anyone sorted this out yet?
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.