We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Multi Relation

Development and Programming

ian Pitts's avatar
ian Pitts
175 posts
17 years ago
ian Pitts's avatar ian Pitts

I made the updates to the extension as you specified and no longer get an error, but also don’t see any related entries displayed. Any ideas?

Thanks again for your help!

       
ebcms's avatar
ebcms
29 posts
17 years ago
ebcms's avatar ebcms

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
       
Brandon Kelly's avatar
Brandon Kelly
257 posts
17 years ago
Brandon Kelly's avatar Brandon Kelly

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; ?>"}
       
stinhambo's avatar
stinhambo
1,268 posts
17 years ago
stinhambo's avatar stinhambo
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; ?>"}

Excellent! I need a way to keep track of methods of improving and working around extensions etc…

       
JCI's avatar
JCI
144 posts
17 years ago
JCI's avatar JCI
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:
global $DB, $FNS, $PREFS, $TMPL, $EXT, /*$all_fields,*/ $Weblog;
Line 467:
if(!isset($$reference->cfields[$PREFS->ini('site_id')])) continue;
Line 469:
$field_id = $$reference->cfields[$PREFS->ini('site_id')][$rel_data['field_name']];
Hopefully Mark can add this to the source for the next release

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?

       
ErwinVanLun's avatar
ErwinVanLun
235 posts
17 years ago
ErwinVanLun's avatar ErwinVanLun

Hi Mark, Your extension looks like if that’s exactly where i’m looking for (avoid heading if no relationships). Where can i find the latest version? Erwin

       
Max Lazar's avatar
Max Lazar
337 posts
17 years ago
Max Lazar's avatar Max Lazar

Hi all, Can somebody tell, how make version of Multi Relation with checkbox’s? It’s possible?

       
Tyssen's avatar
Tyssen
756 posts
17 years ago
Tyssen's avatar Tyssen

Sorry, fixed it. :red:

       
nomolos's avatar
nomolos
24 posts
17 years ago
nomolos's avatar nomolos

Edit: Somehow posted in wrong thread…

       
Deron Sizemore's avatar
Deron Sizemore
1,033 posts
about 17 years ago
Deron Sizemore's avatar Deron Sizemore

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?

       
Deron Sizemore's avatar
Deron Sizemore
1,033 posts
about 17 years ago
Deron Sizemore's avatar Deron Sizemore

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. 😊

       
Deron Sizemore's avatar
Deron Sizemore
1,033 posts
about 17 years ago
Deron Sizemore's avatar Deron Sizemore

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. 😊

       
Simon Cox's avatar
Simon Cox
405 posts
16 years ago
Simon Cox's avatar Simon Cox

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).

       
Deborah Cross's avatar
Deborah Cross
113 posts
16 years ago
Deborah Cross's avatar Deborah Cross

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?

       
Deborah Cross's avatar
Deborah Cross
113 posts
16 years ago
Deborah Cross's avatar Deborah Cross

I went looking for an alternative and found Playa (http://brandon-kelly.com/apps/playa/).

As soon as I downloaded and enabled this extension, Mark’s MultiRelationship stuff started working!

I don’t know why, but I ain’t complaining!

       
First 9 10 11 12 13 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.