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

ExpressionEngine Logo ExpressionEngine
Features Pro new 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

juro's avatar
juro
118 posts
14 years ago
juro's avatar juro

iso100, you’ll have to include more details on what you are doing. Code exampled, etc. Otherwise we can’t help you.

       
timkelty's avatar
timkelty
177 posts
14 years ago
timkelty's avatar timkelty

iso100, If you’re totally getting nothing, turn on PHP errors if they’re not. Relationships have totally blanked my templates before because of PHP memory issues. All I had to do was increase the PHP memory limit

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

Juro, all I have to do is put in {related_entries id="related_files} and POOF. Nothing. Remove the tag and all is well.

Tim, do you think I’d have PHP memory issues even when hosting on EngineHosting? I thought they were the EE hosting “masters!” How do I turn on PHP errors and/or increase the PHP memory limit?

       
timkelty's avatar
timkelty
177 posts
14 years ago
timkelty's avatar timkelty

iso100, Not sure about enginehosting…I’m sure turning on error reporting is in the wiki.

If you change the field to a regular relation field, rather than the multi-relation does it fix it?

       
juro's avatar
juro
118 posts
14 years ago
juro's avatar juro

iso100, is that the exact code? Because you are missing the closing “.

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

Juro, no… I was just typing it out quickly as an example. Whoops.

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

Alright, another update.

I changed index.php to enable error reporting by changing from this:

error_reporting(0);

to:

error_reporting(E_ALL);

… and I still get a blank page when I add this code to my template:

{related_entries id="related_files"} 
{/related_entries}

So then, working from these instructions, I added the following line to index.php:

ini_set('display_errors', 1);

Still a blank page and no errors reported.

Finally, I changed the custom field type to a related field, updated the relationship data for the record and saved. The first reload resulted in a flash of some error messages but it automatically cleared within a split-second and I couldn’t get it to display again.

Looks like I need to either talk with EngineHosting or ExpressionEngine tech support. This is enormously frustrating.

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

Yet another update. EngineHosting finally got PHP errors turned on. I now get this error displayed at the top of my page:

Notice: Undefined index: related_files in /www/eh7045/public_html/pbmsys/extensions/ext.multi_relationship.php on line 471

Notice: Undefined index: field_id_ in /www/eh7045/public_html/pbmsys/extensions/ext.multi_relationship.php on line 478

(It repeats about 15 times)

       
ms's avatar
ms
274 posts
14 years ago
ms's avatar ms

iso100, I’m wondering if you have followed the instructions to patch the core files as mentioned on top of ext.multi_relationship.php:

This will break in PHP4 because call_user_func_array does not support passing by reference, at least as far as I can tell. To get around this, open your /system/modules/weblog/mod.weblog.php file and find this line: …

The extension has worked for me all the time and is still doing so in 1.6.3, but I’m on PHP5.

.Markus

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

Thanks Marcus. I actually looked into that, but since I’m on EngineHosting, I’m running 5.1.6 of PHP.

       
ms's avatar
ms
274 posts
14 years ago
ms's avatar ms
Thanks Marcus. I actually looked into that, but since I’m on EngineHosting, I’m running 5.1.6 of PHP.

Sorry for that … I really thought I’d read EH would use PHP 4 (at least for some clients) - but I must have messed that 😖

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
14 years ago
Leevi Graham's avatar Leevi Graham
Yet another update. EngineHosting finally got PHP errors turned on. I now get this error displayed at the top of my page:
Notice: Undefined index: related_files in /www/eh7045/public_html/pbmsys/extensions/ext.multi_relationship.php on line 471

Notice: Undefined index: field_id_ in /www/eh7045/public_html/pbmsys/extensions/ext.multi_relationship.php on line 478
(It repeats about 15 times)

Are you using Multiple Site Manager?

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
14 years ago
Leevi Graham's avatar Leevi Graham

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

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
14 years ago
Leevi Graham's avatar Leevi Graham

DELETED BY LEEVI

       
ian Pitts's avatar
ian Pitts
175 posts
14 years ago
ian Pitts's avatar ian Pitts
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 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

Oh man, if this works I really owe you one!

I noticed one possible issue though. Line 467 in my copy of the plugin is the start of a “for each” loop:

for each($TMPL->related_data as $key => $rel_data)

… and 469 is an “if” statement:

if(!isset($$reference->cfields[1])) continue;

Perhaps you meant 469 and 471?

       
First 8 9 10 11 12 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.