Unable to create draggable view with relationship

Created on 23 September 2013, about 11 years ago
Updated 22 February 2023, almost 2 years ago

I have two content types: Parent & Child and my ultimately goal is to have an admin tab pointing at a view that emulates the core drupal book module's ordering behavior at a better URL such as /node/%/order-pages. One parent may have many children, but children may have only one parent, defined by an entity relationship with a field on the child pointing to the parent. Weights are set on the children.

When I build a view (or slightly modify the included "weight" view) of "all" child objects in the site to construct a draggable admin table, adding required fields and weight, everything is fine. Similarly, if I add a Contextual Filter to filter to a specific NID, everything works fine and I only see a row for that one object and it's weight. But if/when I try to limit the view by adding a relationship, so that my contextual filter points to the parent's NID, and the table displays the limited set of referenced objects, the weighting feature no longer works. In the views admin screen, if/when I toggle the show/hide row weights the select boxes are completely empty whereas without the relationship or contextual filter they would have select boxes with the correct weight values. The display ordering is correct, however. If I go ahead and save and view a page of the view, I get the following errors:


Notice: Undefined property: stdClass::$nid in weight_handler_field_weight->views_form() (line 33 of /path/to/modules/weight/views/weight_handler_field_weight.inc).

Warning: array_key_exists(): The first argument should be either a string or an integer in weight_handler_field_weight->views_form() (line 38 of /path/to/modules/weight/views/weight_handler_field_weight.inc).

Notice: Undefined property: stdClass::$nid in weight_handler_field_weight->views_form() (line 45 of /path/to/modules/weight/views/weight_handler_field_weight.inc).

Warning: array_key_exists(): The first argument should be either a string or an integer in weight_handler_field_weight->views_form() (line 46 of /path/to/modules/weight/views/weight_handler_field_weight.inc).

Notice: Undefined property: stdClass::$nid in weight_handler_field_weight->views_form() (line 53 of /path/to/modules/weight/views/weight_handler_field_weight.inc).

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024