Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
As per http://drupal.org/node/1697182, we should replace calls to get the $node->title with the $node->label() method instead. This patch covers the existing (already converted) tests, and one instance in search.views.inc. The other (3) instances I can take care of in the sandbox, as they are in the plugins.
Comment | File | Size | Author |
---|---|---|---|
#10 | 1715458-10.patch | 12.04 KB | damiankloip |
#9 | 1715458-node_label-9.patch | 11.94 KB | dawehner |
#6 | 1715458-node_label.patch | 10.18 KB | dawehner |
views.node-label.patch | 3.14 KB | damiankloip | |
Comments
Comment #1
dawehnerSo the node.title field handler should call $node->label() as well?
Comment #2
damiankloip CreditAttribution: damiankloip commentedMaybe, I did a commit in the sandbox earlier of the obvious calls to this on in the plugins : http://drupalcode.org/sandbox/damiankloip/1685040.git/commitdiff/6410651
Comment #3
aspilicious CreditAttribution: aspilicious commentedThats incorrect:
"However, setting the node title directly will still use $node->title = $new_title;."
Comment #4
damiankloip CreditAttribution: damiankloip commentedWhat part is incorrect? I know we should be using $node->title if we are setting but I don't see where are we setting the node title in this patch or the sandbox. In views we aren't really going to be setting anything on nodes.
Comment #5
aspilicious CreditAttribution: aspilicious commentedAh I thought "$item->title = $node->label();" was setting the node title direclty but I was wrong :)
Comment #6
dawehnerSome more places...
Comment #7
damiankloip CreditAttribution: damiankloip commentedGood spot! Looks good.
Comment #8
tim.plunkettWhat about views_handler_argument_node_vid and views_handler_argument_node_nid?
Comment #9
dawehnerURGS, anyone with a better idea?
Comment #10
damiankloip CreditAttribution: damiankloip commentedHmm, not sure. I can't really think of a clean way to do this either. We do need to change the query/logic slightly though I think, as we can't just node_load_multiple($this->value) as that will use vids as nids.
Comment #11
dawehnerOH i see this handler is basically broken in 7.x as well
Comment #12
dawehnerTested a bit and committed them.
I will patch all other instances of entities in another issue.