Plugin

Developer
Supported

Tied Entries

ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Adam Khan

     

You must be logged in to post.

PHP errors

Support Request

Macrike
Macrike

Setup:

I have a review channel, a game channel and a genre channel (as well as other channels, like platform, publisher, developer, etc.). In the genre channel I have a a few entries (one for each genre, like Action, Racing, etc.). In the game channel I have one entry for each game, with a Playa field (game_genre) where I select the genre of the game (as well as a Playa field for selecting platform, a Playa field for developer, etc.). The review channel is where I publish a review for certain game. There, I have a Playa field (review_related_games) where I select the related game.

I have a template that displays the review article and I want to info from the game, such as the genre. So, as far I understand from the docs, I need something like this:

http://example.com/review/entry/123/

{exp:tied_entries entry_id="{segment_3}" tie=">review_related_games>game_genre"}
Genre
{tied:title}
{
/exp:tied_entries} 

But, with that code I’m getting the following error:

A PHP Error was encountered
Severity: Notice
Message: Undefined variable: fields_name
Filename: tied_entries/pi.tied_entries.php
Line Number: 323

A PHP Error was encountered
Severity: Warning
Message: Invalid argument supplied for foreach()
Filename: tied_entries/pi.tied_entries.php
Line Number: 323

A PHP Error was encountered
Severity: Notice
Message: Undefined variable: fields_name
Filename: tied_entries/pi.tied_entries.php
Line Number: 323

A PHP Error was encountered
Severity: Warning
Message: Invalid argument supplied for foreach()
Filename: tied_entries/pi.tied_entries.php
Line Number: 323

And even though I do get the title of the genre, I’m also getting the titles of other Playa fields from said game, like platform, developer, publisher, etc.

Any clues? I can’t figure out what I’m doing wrong here.

I’m using PHP Version 5.3.5 and MySQL 5.1.54.

Adam Khan
# 1
Developer
Adam Khan

Macrike, I didn’t test for multiple Playa fields in one entry, so I think the chances are you’re doing nothing wrong, and the plugin just has to be fixed. I will replicate your scenario to test and fix.

-Adam

Adam Khan
# 2
Developer
Adam Khan

Hi, and apologies for the weeks-long lag time. I’ve now fixed the plugin with v1.4.4 v.1.4.5 to work when there’s more than one Playa field in an entry.

davedriesmans
# 3
davedriesmans
{exp:channel:entries channel="categories" orderby="entry_date" sort="desc"}
   {reverse_related_entries sort
="desc" channel="books"}
        
<h2><a href="{title_permalink=">AUTHOR {related_entries id="author_link" channel="author"} {title}{/related_entries}</a></h2>
        <
h3><a href="{title_permalink=">{title}</a></h3>
    
{/reverse_related_entries}
{
/exp:channel:entries} 

i have problem here showing the author.
categories = channel
books = channel
author = channel
author_link = short name of relationship field in channel books
category_link =  short name of relationship field in channel books

so think tied entries could help:

{exp:channel:entries channel="categories" orderby="entry_date" sort="desc"}
   {reverse_related_entries sort
="desc" channel="books"}
            {exp
:tied_entries entry_id="{entry_id}" tie=">books>author_link" limit="1"}
                   
<h2>AUTHOR: <a href="{path=/autores/autore/}{tied:url_title}">{tied:title}</a></h2>
            
{/exp:tied_entries}
            
<h3><a href="{title_permalink=">{title}</a></h3>
    
{/reverse_related_entries}
{
/exp:channel:entries} 

i use EE v2.2.1, but nothing shows in the {tied:title}, whatever i try with the tie parameter.
what should it be?

Adam Khan
# 4
Developer
Adam Khan

Davedriesmans, you’re already in the books channel when you call the tied_entries plugin so it shouldn’t be in the tie. Make it tie=”>author_link”.

Adam Khan
# 5
Developer
Adam Khan

You could also do it directly from the outer channel:entries tag, ie:

{exp:channel:entries channel="categories" orderby="entry_date" sort="desc"}
            {exp
:tied_entries entry_id="{entry_id}" tie="<books>author_link" limit="1"}
                   
<h2>AUTHOR: <a href="{path=/autores/autore/}{tied:url_title}">{tied:title}</a></h2>
            
{/exp:tied_entries}
            
<h3><a href="{title_permalink=">{title}</a></h3>
{/exp:channel:entries} 
davedriesmans
# 6
davedriesmans

i tried both and your first answer was the first thing i tried but i get php errors:
Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘3)) ORDER BY d.entry_id’ at line 1

SELECT r.rel_child_id AS result_id FROM exp_channel_data AS d, exp_relationships AS r WHERE d.field_id_10 = r.rel_id AND d.entry_id = ANY (SELECT r.rel_parent_id AS result_id FROM exp_channel_data AS d, exp_relationships AS r WHERE d.channel_id = 2 AND r.rel_parent_id = d.entry_id AND r.rel_child_id IN 3)) ORDER BY d.entry_id ;

Filename: third_party/tied_entries/pi.tied_entries.php

Line Number: 555

Adam Khan
# 7
Developer
Adam Khan

OK, I must have introduced a bug when adding the Playa 4 compatibility and didn’t test enough. I’ll take a look and get back to you.

davedriesmans
# 8
davedriesmans

hi, i have to launch the site on the 16th august… hope you have some time to look to it next week as you plugin is key… -dave

davedriesmans
# 9
davedriesmans

any news? really need an update…

davedriesmans
# 10
davedriesmans

i did it without tied entries, please paypal my money back to my account. thanks.

Adam Khan
# 11
Developer
Adam Khan

Dave,

My apologies, I totally dropped the ball here. Did you get the refund?

-Adam

davedriesmans
# 12
davedriesmans

i’m afraid not :)

Adam Khan
# 13
Developer
Adam Khan

OK, sending you $20 via PayPal… Is that OK? Can you email me at adam@engaging.net which email address to send to?