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.
Useful to collect later in other views hooks so you can alter the view based on where it came from
patch attached
Comment | File | Size | Author |
---|---|---|---|
#1 | viewfield_embed-the-element-in-view-1715230-1.patch | 616 bytes | galooph |
viewfield_enbed-the-element-in-view.patch | 607 bytes | chrisns | |
Comments
Comment #1
galooph CreditAttribution: galooph commentedThe patch has a slight flaw.
Here's the post-patched code:
views_get_view() will return empty if the view doesn't exist. If this happens, then
$view->viewfield = $element;
will instantiate $view as a standard object. At this point, the first part of theif ($view && $view->access($display))
if statement passes, but as a standard object has no access method, PHP throws a fatal error.I've attached a revised patch where the
$view->viewfield = $element;
line is moved inside theif ($view && $view->access($display))
statement.Comment #2
jerdavisClosing issue as Drupal 6 is no longer actively supported.