Problem/Motivation

\Drupal\views\ViewExecutable::$display_handler and \Drupal\views\ViewExecutable::$displayHandlers
should have corresponding methods, one could call.

Once we do that, we can also mark the public properties as deprecated

Proposed resolution

Remaining tasks

  • Re-roll the patch with the D11 deprecation tags
  • Review patch
  • Write API changes section

User interface changes

API changes

Data model changes

Comments

dawehner created an issue. See original summary.

rob.barnett’s picture

Looks interesting. Suntog, Bart85_ and I are going to look at this as part of the first timers sprint. I'm working on getCurrentDisplayHandler method

Anonymous’s picture

I'm helping with this issue as well at the mentored sprint

suntog’s picture

I am taking a shot at creating a method for ViewExecutable::$displayHandlers.

rob.barnett’s picture

We have changes in place. Grabbing lunch and will put our patches together and proceed after lunch.

Anonymous’s picture

Finished marking the public properties deprecated. Creating patch after lunch

rob.barnett’s picture

Adding a patch for creating ViewExecutable::getCurrentDisplayHandler method. I know this is a partial patch. Suntog and Bart85 are adding the other parts.

suntog’s picture

Status: Active » Needs work
StatusFileSize
new526 bytes

Added an empty method
drupaldrupalcore-add-getDisplayHandlers-2719171-8-8.patch

Anonymous’s picture

Marked the public properties deprecated.

suntog’s picture

Status: Needs work » Needs review
StatusFileSize
new1.44 KB

Combine partial previous patches from Bart85 #9, Suntog #8 and rob.barnett #7 into one patch file.

lokapujya’s picture

  1. +++ b/core/modules/views/src/ViewExecutable.php
    @@ -2128,6 +2134,14 @@ public static function getHandlerTypes() {
    +   * Returns displayHandlers
    

    Missing period.

  2. +++ b/core/modules/views/src/ViewExecutable.php
    @@ -2128,6 +2134,14 @@ public static function getHandlerTypes() {
    +   * ¶
    

    whitespace.

Status: Needs review » Needs work
suntog’s picture

First fix for patch, fixed comments.

suntog’s picture

Status: Needs work » Needs review
StatusFileSize
new1.44 KB

The last patch was an inter-diff.

Status: Needs review » Needs work
lokapujya’s picture

The fail seems unrelated to the patch. I've queued the test against 8.1.x to see what happens.

marvin_b8’s picture

Status: Needs work » Needs review

lokapujya’s picture

Status: Needs review » Reviewed & tested by the community
alexpott’s picture

Status: Reviewed & tested by the community » Needs work

Can we add a couple of calls to the new methods? Also

    $executable->display_handler = NULL;

In ViewUI is the only time we write the value through public access AFAICS so do we need to add an unsetter? This is the same with displayHandlers - so maybe what we need is a corresponding reset method on view executable.

That said is the code in ViewsUI::cacheSet() even necessary given ViewExecutable::serialize()?

I think we need to resolve the question about the value writes before we can deprecate the public properties.

lokapujya’s picture

  1. Can we add a couple of calls to the new methods?

    In other words, replace use of the properties with the new getters. We did discuss that at the code sprint and assumed it was out of scope. But, it can be done here.

  2. In ViewUI is the only time we write the value through public access AFAICS so do we need to add an unsetter?

    Aren't there also instances within tests that set the properties? Should those use a setter?

  3. That said is the code in ViewsUI::cacheSet() even necessary given ViewExecutable::serialize()?

    What is the relationship between serialization and cachSet?

  4. I think we need to resolve the question about the value writes before we can deprecate the public properties.

    We aren't truly deprecating them if they are remaining public. Is the plan to eventually change them to protected?

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

lokapujya’s picture

This first part should be a simple task: Can we add a couple of calls to the new methods?

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

mariacha1’s picture

Issue tags: +Portland2024
Novice issue reserved for the Mentored Contribution during the Contribution Day at DrupalCon Portland 2024. After the 8th of May 2024, this issue returns to being open to all. Thanks
mariacha1’s picture

Issue summary: View changes
xjm’s picture

Issue tags: -Novice, -Portland2024

Given how long it's been since there was activity on this issue and the ongoing discussion about the best approach, it is probably not a good novice issue choice. Thanks!

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.