Hi,

I tired the hook_views_pre_view and variable $view->name returns to me NULL. on drupal 7 is the variable $view->name is correct, but in drupal 8 i think is this function $view->id();

CommentFileSizeAuthor
#10 var-2783117-10.patch3.4 KBAnonymous (not verified)
#10 doc-2783117-10.patch1.36 KBAnonymous (not verified)
#2 core-views_api_php-2783117-0.patch1.77 KBeloivaque

Comments

eloiv created an issue. See original summary.

eloivaque’s picture

StatusFileSize
new1.77 KB
subson’s picture

Status: Active » Needs review

+1

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

+1

catch’s picture

Title: views.api.php variable $view->name not exist » views.api.php variable $view->name does not exist

  • catch committed 17cd892 on 8.3.x
    Issue #2783117 by eloiv: views.api.php variable $view->name does not...

  • catch committed 0882f30 on 8.2.x
    Issue #2783117 by eloiv: views.api.php variable $view->name does not...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to all three 8.x branches, thanks!

  • catch committed dda4e35 on 8.1.x
    Issue #2783117 by eloiv: views.api.php variable $view->name does not...
Anonymous’s picture

StatusFileSize
new1.36 KB
new3.4 KB

Maybe it is useful. The first patch corrects documentation for Views::getViewsAsOptions. The second patch refactors variables, but I'm not so sure.

I also noticed that "$view->name" is used in some contrib modules (accessibility, backbone, calendar, community_tasks, crm_core, data, efq_views, fancy_file_delete, flexiform, global_filter, google_analytics_reports, graphapi, image_replace, ip_geoloc, jqgrid, ldap, legal, merci, message_notify, message_subscribe, monitoring, nodeviewcount, pm, quicktabs, quiz, recently_read, relation, revisioning, skinr, stools, views_autocomplete_filters, views_block_filter_block, views_cache_bully, views_pdf, views_slideshow_xtra, webform, yandex_metrics).

I do not know how many of these modules is still maintaining and how serious a problem in using "$view->name" for them. Also i'm not an apologist for infinity of back compatibility. But maybe it's worth to make cheat sheet for Views with contain info about such changes.

dawehner’s picture

@vaplas
Please open up a new issue

Anonymous’s picture

Thanks, I created a new issue.

dawehner’s picture

Thank you!

Status: Fixed » Closed (fixed)

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