Whatever work was done in #1172970: provide a unified way to retrieve result entities seems to break the signup module.

With rc1 (before this patch), clicking on the signup tab (which goes to /node/%/signups/admin) works just fine.
With views rc3, it results in a WSOD.

The following code is the culprit in the file signup/views/handlers/signup_handler_field_signup_edit_link.inc

    // Line 25-27
    // $this->aliases is empty
    $signup->sid = $values->{$this->aliases['sid']};
    $signup->nid = $values->{$this->aliases['nid']};
    $signup->uid = $values->{$this->aliases['uid']};

If you dpm($table_data); (with the Devel module) on line 37 in views\handlers\views_handler_field_entity.inc (which was added in this patch), you can see there is no entity type. Which in turn, probably, results in the WSOD mentioned above?

    // Line 37-39
    $table_data = views_fetch_data($this->table);
    dpm($table_data);
    $this->entity_type = $table_data['table']['entity type'];

For reference: this is the commit for issue #1172970.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Project: Views (for Drupal 7) » Signup
Version: 7.x-3.0-rc3 » 7.x-1.x-dev
Component: Miscellaneous » Views integration
Status: Active » Needs review
FileSize
883 bytes

Let's move to signup issue queue.

Here is a patch

arh1’s picture

FileSize
885 bytes

Thanks, dereine!

It looks like your patch was missing a couple of semicolons. I re-rolled it.

kristiaanvandeneynde’s picture

The above patch removes the fatal error, but the 'Edit signup' link that used to be in the table at node/%/signups/admin is missing now.

benjf’s picture

FileSize
821 bytes

Here is a slightly different patch, which seems to solve this problem for me (and the 'edit signup' links are back). I don't see anything too specific to my situation in there, but please test.

dawehner’s picture

@benjf
I'm sorry but sadly your patch is wrong you have to use the interval aliases produced by views.

benjf’s picture

hmmm, any suggestions on a solution? or why mine is "wrong" but seems to fix the problem?

The patch from #2 takes care of the fatal error, but I wonder if this piece of code is really "working"? (since it's supposed to generate the edit link and does not).

dpm($signup); results:

$signup->sid (Boolean) FALSE
$signup->uid (Boolean) FALSE
$signup->nid (NULL)

Anonymous’s picture

Following

cwyant’s picture

Subscribe. I get WSOD when adding "edit signup link" field.

sgabe’s picture

Status: Needs review » Reviewed & tested by the community

The patch in #2 applies fine and eliminates the following error on node/[nid]/signups/admin path:

Fatal error: Cannot access empty property in [...]\www\sites\all\modules\signup\views\handlers\signup_handler_field_signup_edit_link.inc on line 24

kristiaanvandeneynde’s picture

Status: Reviewed & tested by the community » Needs work
sgabe’s picture

Status: Needs work » Reviewed & tested by the community

IMO this is good to go and that is another issue, see #1426028: Edit signup link is not displaying. This issue is about the fatal error which needs to be fixed ASAP.

sgabe’s picture

Title: Updating RC3 breaks Signup module » Updating to Views 7.x-3.0-rc3 breaks Signup module
Status: Reviewed & tested by the community » Fixed

Committed, thanks!

sgabe’s picture

Status: Fixed » Needs review
FileSize
1.68 KB

It seems this issue has been treated wrongly. I think what we need here is to add the node ID as an additional field to the constructor.

The attached patch reverts the patches in #1358258-2: Updating to Views 7.x-3.0-rc3 breaks Signup module and in #1426028-1: Edit signup link is not displaying and fixes the WSOD and the edit link.

Since I can't reproduce the empty aliases as the issue summary says, please test and report back.

kristiaanvandeneynde’s picture

I can confirm that 7.x-1.x-dev + this patch removes the WSOD -and- fixes the edit links.

Cross referencing because this seems to also fix #1428276: Double, threefold and so on entries in the admin interface

kristiaanvandeneynde’s picture

Status: Needs review » Reviewed & tested by the community

Setting to RTBC although my xref in #14 should be further tested.

jordojuice’s picture

Status: Needs review » Reviewed & tested by the community

Indeed.
This patch is essentially the same as my patches in #1285536: SQL error when using Signup: Enabled/Disabled (Enabled) and #1399178: Ajax error when trying to use the sign up link in a view, and those worked for me. I'll mark those as dupes.

EDIT: Meant to mark #1447506: stdClass could not be converted to string in signup edit field as duplicate, but just merged changes from #1399178: Ajax error when trying to use the sign up link in a view below.

jordojuice’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
2.8 KB

Ney. There's another issue in the signup_node_link handler. The nid field is never loaded. See #1399178: Ajax error when trying to use the sign up link in a view. Here's an updated patch with those changes.

kristiaanvandeneynde’s picture

Status: Reviewed & tested by the community » Needs review

I do not seem to have that issue, so can't verify whether the added changes fix it.

What are the steps to reproduce?

chaloum’s picture

jordojuice

I've tested it and the Ajax error no longer occurs but no link is displayed in the view (result not form)
for Signup current user form I wont save the other choices, Signup user list, Administer signups, signup settings, Form to sign up other users and Signup broadcast from.

I suspect the choice Signup current user form only display because its the default

and the check box "set view as return destination" doesn't save

jordojuice’s picture

I reproduced it with the cloned 7.x-1.x branch - I just added a Node: Signup link to a node view. Views should display an error (did for us)

jordojuice’s picture

Status: Needs review » Needs work

Hmm... needs work? I'll have to try to check it out tomorrow night if no one else gets to it before me.

It does seem there are still some issues...

sgabe’s picture

Status: Needs work » Fixed

Since jordojuice's patch does not affect the original patch in #13 and we have a separate issue about the signup node link problem, lets deal with it there.

The patch in #13 is committed. The signup node link should be fixed in #1399178: Ajax error when trying to use the sign up link in a view.

Status: Fixed » Closed (fixed)

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

flightrisk’s picture

Status: Closed (fixed) » Active

I've been bouncing around between a dozen threads that keep hitting dead ends where people say "this is a duplicate", but I can't find the fix. I am also getting this error:

Fatal error: Cannot access empty property in .../sites/all/views/handlers/signup_handler_field_signup_edit_link on line 23

Is there a fix for this?

I just did the automatic update to Signup 7.x-1.x-dev (2012-Feb-29)
and am using Views 7.x-3.x-dev (2011-Nov-27). Old version, but the latest dev releases seem to break a lot of modules.

The drupal update section points to the Feb 29 version, so I would have to manually try the latest dev release, but all the fixes seem to say Feb 29 *IS* the latest version. The commits log shows the last commit was Feb 29, yet the main page shows you can download a March 1 version. Maybe that is just the day it was uploaded and not the actual build date?

jordojuice’s picture

I think I had a patch for that bug in another issue. I though @sgabe committed it but maybe I'm thinking of something else.

EDIT: Indeed, it looks like my patch in #17 covered the bug in signup_handler_field_signup_edit_link.inc. Did that part not get committed?
I'll check it out to see if it needs another patch or what.

jordojuice’s picture

Status: Active » Fixed

I just pulled the latest commits and the fix from #17 and other patches is in there. I'm gonna download the snapshot though.

jordojuice’s picture

Status: Fixed » Active

I also downloaded the March 1st snapshot and the fix is in there, so maybe this is still an issue for some reason, though I can't reproduce it.

However, note that with the bug fix line 23 is global $user;, whereas prior to the bug fix line 23 was the line with the bug, so it doesn't appear that the version you are using has the fix which is strange since I'm looking at the dev snapshot.

signup_handler_field_signup_edit_link.inc should have:

<?php
/**
 * Field handler to generate a link to edit a given signup.
 */
class signup_handler_field_signup_edit_link extends views_handler_field_node_link {
  function construct() {
    parent::construct();
    $this->additional_fields['sid'] = array(
      'table' => 'signup_log',
      'field' => 'sid',
    );
    $this->additional_fields['uid'] = array(
      'table' => 'signup_log',
      'field' => 'uid',
    );
    $this->additional_fields['nid'] = array(
      'table' => 'signup_log',
      'field' => 'nid',
    );
  }

  function render($values) {
    global $user;

    // Check access to edit this signup.
    $signup = new stdClass();
    $signup->sid = $values->{$this->aliases['sid']};
    $signup->nid = $values->{$this->aliases['nid']};
    $signup->uid = $values->{$this->aliases['uid']};
?>

...etc

flightrisk’s picture

Ok, this is crazy, I flushed the cache a few times yesterday but did not log out. Today's error is different:

Fatal error: Cannot access empty property in /home/mckenzie/public_html/sites/all/modules/signup/views/handlers/signup_handler_field_signup_edit_link.inc on line 27

If me text editor is correct the indicated line is where I am now getting an error trying to view the signups:

// Check access to edit this signup.
$signup = new stdClass();
$signup->sid = $values->{$this->aliases['sid']}; <------- line 27
$signup->nid = $values->{$this->aliases['nid']};
$signup->uid = $values->{$this->aliases['uid']};

-alex-’s picture

I face the same error