Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
views.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
19 Oct 2014 at 22:24 UTC
Updated:
24 Nov 2014 at 06:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
michaellenahan commentedComment #2
michaellenahan commentedI'm confused!
Should $current_page not properly be *private* scope?
It is not used anywhere else except in the ViewExecutable class, and it is wrapped by getter and setter functions.
Both of these are referenced by Test classes, so should they not remain as public scope?
Comment #3
dawehnerWell, we don't use protected in Drupal, because subclasses can't really access it. You never know, maybe someone comes up with a subclass of ViewExecutable and then you are kinda fucked when stuff is private instead of just protected.
Comment #4
michaellenahan commentedOK. So it's just the *properties* that get set to protected. I have to learn to read better. :)
I see now that it's the getter/setter methods which allow us to set the property to protected.
Here's the patch.
As a follow-up, do the following properties need getter/setter methods, so that they can be set to protected?
- $total_rows
- $attachment_before
- $attachment_after
- $exposed_data
- $exposed_raw_input
... or is it overkill.
Comment #5
dawehnerThank you for the work! Let's set the issue to needs review in order to figure out what the testbot thinks about it ...
We can work on so many things, do you want to create an additional issue for that?
Comment #9
michaellenahan commentedNot sure what is going on here.
Test fails because ViewExecutable::setDisplay() is called without an argument.
The patch makes no change to SetDisplay() though.
Comment #10
dawehner@michaellenahan
Well, the problem is not the debug message (that one is actually intended)
but the problem is that the property is not accessible anymore (as you marked it as protected).
Instead we should check for the default value of the method result. Sadly this opens up another bug, as the display handlers might not be defined
at some point in time.
Here is an interdiff which fixes the problem.
Do you want another issue?
Comment #11
michaellenahan commentedYes please :)
Comment #12
michaellenahan commentedComment #13
dawehnerWell, the actual work was done without my work already.
Comment #14
alexpottThis issue is a prioritized change as it reduces fragility by removing public access to properties that should not be and so is allowed as per https://www.drupal.org/core/beta-changes and it's benefits outweigh any disruption. Committed 08bf45f and pushed to 8.0.x. Thanks!
Unused use added.