Steps to reproduce:
* Test a weight view (tested the module's default page display, as well as cloning it for a block display).
* Edit the Field: Title, by unchecking "Link this field to the original piece of content".
* When viewing the page or block with this view, I get these errors:
Notice: Undefined property: stdClass::$nid in weight_handler_field_weight->views_form() (line 27 of PATH_TO_THEME/modules/weight/views/weight_handler_field_weight.inc).
Notice: Undefined property: stdClass::$nid in weight_handler_field_weight->views_form() (line 39 of PATH_TO_THEME/modules/weight/views/weight_handler_field_weight.inc).
Warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in weight_handler_field_weight->views_form() (line 40 of PATH_TO_THEME/modules/weight/views/weight_handler_field_weight.inc).
Notice: Undefined property: stdClass::$nid in weight_handler_field_weight->views_form() (line 47 of PATH_TO_THEME/modules/weight/views/weight_handler_field_weight.inc).
Comments
Comment #2
davisbenI was unable to reproduce this. It is working as expected after following your steps. One thing that looks odd to me me is the path. Is there a reason the module is under your theme's directory?
Comment #3
davisbenI was unable to reproduce this. It is working as expected after following your steps. One thing that looks odd to me me is the path. Is there a reason the module is under your theme's directory?
Comment #4
echoz commentedOoops, I just wrote that incorrectly, that was meant to be - path to - sites/all/modules.
Thanks for checking, I ended up working around it by rewriting to have it a link to the node edit page. Now I'm curious what's different about my setup. I'll see what happens in future testing.
Comment #5
davisbenIf you export your view and paste it here I'll compare it against the working one I have.
Comment #6
echoz commentedThanks. Here’s the module’s default view (which I’m not using, but results in a clean demonstration of my errors). I have one simple content type using Weight. The only change to the default view, same as described in the issue summary, is the Field: Title has "Link this field to the original piece of content" unchecked.
Comment #7
davisbenThis is being caused by the nid not being passed to the view when "Link this field to the original piece of content" is unchecked. A quick fix is to add a nid field, excluded from the display. I'll need to look into a better, permanent solution.
Comment #8
davisbenThis is fixed now. I'm adding the nid as an additional field in the weight views handler.