EE4 compatibility updates:

  • Publisher is EE4 and EE5 compatible, but it does not currently support the Fluid field.
  • Reel is EE4 and EE5 compatible, but it does not currently support the Fluid field.

Ticket: Relationship data lost in ignored channel after installation

Status Backlog
Add-on / Version Publisher Lite 2.4.2
Severity
EE Version 3.5.4

KeesTM

Apr 19, 2017

Description:
I’m not sure if the error which appears after/during the installation is responsible for the disappearance of the relationship data, or maybe it’s because publisher get-parameters are added to the edit-page URL (/system/index.php?/cp/publish/edit/entry/14074&publisher_status=draft), but as soon as I uninstall publisher, the relationship data returns.

Detailed steps to reproduce the issue:
1. Install Publisher Lite 2.4.2 in EE 3.5.4 with existing data
2. Error appears: Argument 1 passed to BoldMinded/Publisher/Service/Session::setCurrentLanguage() must be an instance of BoldMinded/Publisher/Model/Language, null given, called in system/user/addons/publisher/Service/Session.php on line 605 and defined..
Fatal error: Call to a member function getId() on null in system\user\addons\publisher\Service\Session.php on line 420 on page /system/index.php?/cp/addons
3. Removing cookies seems to fix this problem, so I log back in after that.
4. Enable ignore and add channel (which contains saved relationship data) to Ignore settings
5. Find out the relationship data for the ignored channel is still lost…

Is this a known issue? I can arrange acces to a acceptance environment if you can’t find a way to reproduce this problem.

#1

BoldMinded (Brian)

Apr 19, 2017

This is a new issue.

Can you be more clear on which channel is ignored? Is it the parent channel that contains the relationship field or the child channel that should be displaying relationships in a field in a non-ignored channel?

#2

Kees Internetbureau

Apr 25, 2017

Hi Brian,

Thank you for your fast reply! It is the parent channel relationship field which loses it’s data after Publisher has been installed, and the parent channel itself is ignored.

#3

BoldMinded (Brian)

Apr 25, 2017

Ok, I don’t think there is any data lost, its there, but its just not querying it correctly. I’ll take a look at that part of the code and see if I spot the issue. I’m hoping to get a new build out this week or early next. If I find a fix I’ll post the build here for you to test.

#4

BoldMinded (Brian)

Apr 25, 2017

Would you be able to do me a favor and add this line and then reload an entry in the ignored channel that is supposed to have child relationships, then paste back the var_dump value?

Line 137 of legacy/libraries/hooks/Publisher_relationship_hooks.php

var_dump(ee()->db->last_query()); 

#5

Kees Internetbureau

Apr 26, 2017

Hi Brian,

I pasted the var_dump on line 137 of legacy/libraries/hooks/Publisher_relationship_hooks.php as you suggested, but the output returned nothing. Further investigation showed that this function is not trigegred at all…

On the bright side: I did fin this error in the console log of the ignored channel that is supposed to have child relationships:
Uncaught SyntaxError: Unexpected token < (https://onzetaal17.dev/webmanager/index.php?S=0&D=cp&C=javascript&M=load&file=ext_scripts)

This page contains a Publisher related error:

<div class="err-wrap notice"  err_toggle(this)">
 <h1>Notice</h1>
 <h2>Trying to get property of non-object</h2>
 <p>C:/Users/ZefPC/Documents/DEV/onzetaal17/public_html/webmanager/user/addons/publisher/ext.publisher.php, line 1195 <a class="
toggle" rel="notice-info" href="#">show details</a></p>
 
<div class="details notice-info">
  <
ul>
   <
li><b>Severity</b>: E_NOTICE</li>
  </
ul>
 </
div

The error seems to point to this line:
$latest = $versionService->setAddon(‘publisher-2’)->fetchLatest();
Apparently this function doesn’t return the expected object..

#6

BoldMinded (Brian)

Apr 26, 2017

That error is unrelated to the current issue, but good to know.

Is this relationship field inside of a Grid? If so move that var_dump to line 107 just before return $requested_query->result_array();

if its not in a grid move the var_dump to line 117.

To be 100% sure the function is called at the var_dump to line 53.

#7

Kees Internetbureau

Apr 26, 2017

No result after pasting the var_dump on line 117 and opening the relationship entry either.
No result after pasting

echo "check"; exit; 

just after the function relationships_query opens on line 53 either.
Maybe the installation is incomplete, since I always get the error I described earlier when installing?

#8

BoldMinded (Brian)

Apr 26, 2017

yeah thats weird. Check the exp_extensions table for a row similar to this:

127 Publisher_ext relationships_query relationships_query  5 2.5.0 y 
#9

BoldMinded (Brian)

Apr 26, 2017

You should have 45 rows in that table with the class name “Publisher_ext”

#10

Kees Internetbureau

Apr 26, 2017

They’re all present, including the one you mentioned. But the version number is 2.5.1 instead of 2.4.1 .
Maybe I should try a newer version?

#11

BoldMinded (Brian)

Apr 26, 2017

The version number in the extensions table doesn’t really mean much.

The relationships_query() function is only called on the front-end. relationships_display_field() is what is called in the CP. Try putting var_dumps at various points in that function and see what the last query is. You can do var_dump(ee()->db->last_query());

Login to reply

Contact

For add-on support, please use the Support section. General inquries and pre-sale questions can be sent to support@boldminded.com.