In #2002914: Rename Views method get_field_value() to getFieldValue() the access for getFieldValue was changed to protected (in addition to the rename). Quote from that issue:

Add protected access modifier in front of the function to adher to the new OOP standards.

I wonder why exactly? The function getField (which returns the rendered fields) is public. In a module I maintain (Views Send) I need access to both the rendered and raw fields.

If there is some unknown reason for keeping getFieldValue protected, I would like to know what the preferred work-around is.

PS! Very grateful for the work all of you do in making Drupal 8 happen.

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Bug because contribs may depend on this.
Prioritized changes The main goal of this issue is improving developer experience and usability.
Disruption none
CommentFileSizeAuthor
#6 2206485-6.patch685 bytesAnonymous (not verified)
#1 2206485-remove-protected-getFieldValue-1.patch727 bytessandipmkhairnar

Comments

sandipmkhairnar’s picture

Remove Protected access modifier.

sandipmkhairnar’s picture

Status: Active » Needs review
hansfn’s picture

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

Status: Reviewed & tested by the community » Needs work
Issue tags: +VDC

Tagging VDC to give views maintainers a chance to look at this.

If the method is public, it should be explicitly marked as public per coding standards.

damiankloip’s picture

I thought I filed an issue for this alreayd, can't find it though. We want to do this anyway I think.

Catch is right though, we need to replace 'protected' with 'public' not just remove the visibility.

Anonymous’s picture

StatusFileSize
new685 bytes

Rerolled and explicitly marked the method "public".

Anonymous’s picture

Status: Needs work » Needs review
hansfn’s picture

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

Issue summary: View changes

Added a beta phase evaluation to the summary.

dawehner’s picture

+1

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

This issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed 3b2f71b and pushed to 8.0.x. Thanks!

  • alexpott committed 3b2f71b on 8.0.x
    Issue #2206485 by pjonckiere, sandipmkhairnar: StylePluginBase::...

Status: Fixed » Closed (fixed)

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