Steps:
1) Added a node context that contained a user reference field
2) Added a "user from reference" relationship
3) In the modal window, made no changes, just hit "Save"
4) BING, error popup!
Error: An error occurred while attempting to process /drupal-6.2/?q=ctools/context/ajax/add/delegator/relationship/user_view_panel_context/user_from_userref

Additional PHP log error: PHP Fatal error: Cannot access empty property in C:\wamp\www\drupal-6.2\sites\all\modules\cck\modules\userreference\panels\relationships\user_from_userref.inc on line 32

The relationship does not save. If I close the relationship window and immediately attempt to 'continue' in Panels, I get the php error again, but in my browser this time. If I go back, refresh the panel page, and then try continue again, it works.

For further enjoyment:
1) Added a node context that contained a user reference field
2) Hit 'continue' to "save" that context.
3) Back to get back to the contexts page.
4) Attempted to add the user reference. Same error.
5) Refreshed the page.
6) Attempted to edit the context to make sure that the selected NID was saved, and got this error in the ui:
An error occurred while attempting to process /drupal-6.2/?q=ctools/context/ajax/configure/delegator/context/user_view_panel_context/0
The same 'empty property' error appears in the PHP error log.

The 'edit context' modal is um. Toast:) It's hanging there with the 'waiting' spinner. If I choose 'close window', refresh the page, and then try to edit the context again, it opens.

Comments

yched’s picture

Project: Content Construction Kit (CCK) » Panels
Version: 6.x-2.x-dev » 6.x-3.x-dev
Component: Panels Integration » Plugins - relationships

Bumping to Panels queue see if it rings a bell over there.

merlinofchaos’s picture

Heh, I had her put that in the CTools queue. As near as i can tell for some reason the variable that is *supposed* to hold the uid is appearing to be empty on the node. I don't know if it's because something in CCK has changed since D5 or not; all I did was port the userreference forward from D5.

It is this code that is failing:

  isset($context->data->{$conf['field_name']}[0]['uid'])
yched’s picture

Lol, I didn't notice the OP was esmerel :-)

Hm, the structure of userref values hasn't changed since D5. If $context->data is supposed to contain the context node, then this should provide the uid. You can however, have a case where the node has no value for this field., and this isset() will be FALSE.

merlinofchaos’s picture

Ah interesting. But we're not getting a FALSE we're getting an error because the stuff in the {} evaluates to nothing, I think. Maybe that just needs to be done in two steps. Thanks for the insight.

esmerel’s picture

I'm crushed. Heartbroken.

OK not really ;)

merlinofchaos’s picture

Status: Active » Needs review
StatusFileSize
new2.28 KB

So the whole problem was that the settings form name and function didn't match up, and so the actual field was never being chosen. This fixes that, but won't fix the broken non-data in existing userreferences. I doubt there are any since leaving the relationship in causes whitescreens so nobody would be using it.

merlinofchaos’s picture

Project: Panels » Content Construction Kit (CCK)
Version: 6.x-3.x-dev » 6.x-2.x-dev
Component: Plugins - relationships » Panels Integration

I totally forgot ot bump this back to the right queue!

markus_petrux’s picture

Status: Needs review » Fixed

Catched and committed to CCK2 and CCK3. :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.