Files: 
CommentFileSizeAuthor
#17 interdiff-11-12.txt970 bytesmartin107
#17 drupal8.views-module.FieldPluginBase.2052591-12.patch31.71 KBmartin107
FAILED: [[SimpleTest]]: [MySQL] 59,481 pass(es), 12 fail(s), and 3 exception(s).
[ View ]
#13 interdiff-10-11.patch908 bytesmartin107
FAILED: [[SimpleTest]]: [MySQL] Setup environment: Test cancelled by admin prior to completion.
[ View ]
#13 drupal8.views-module.FieldPluginBase.2052591-11.patch30.81 KBmartin107
FAILED: [[SimpleTest]]: [MySQL] 59,477 pass(es), 12 fail(s), and 3 exception(s).
[ View ]
#11 interdiff.txt14.61 KBmartin107
#11 drupal8.views-module.FieldPluginBase.2052591-10.patch29.96 KBmartin107
FAILED: [[SimpleTest]]: [MySQL] 59,508 pass(es), 13 fail(s), and 153 exception(s).
[ View ]
#9 find-usages-twig.png537.36 KBYesCT
#9 drupal8.views-module.FieldPluginBase.2052591-9.patch32.75 KBYesCT
FAILED: [[SimpleTest]]: [MySQL] 57,177 pass(es), 6 fail(s), and 150 exception(s).
[ View ]
#9 interdiff-6-9.txt2.74 KBYesCT
#6 drupal8.views-module.FieldPluginBase.2052591-6.patch34.23 KBYesCT
FAILED: [[SimpleTest]]: [MySQL] 57,680 pass(es), 6 fail(s), and 150 exception(s).
[ View ]
#6 interdiff-2-6.txt29.84 KBYesCT
#2 drupal8.views-module.FieldPluginBase.2052591-2.patch5.23 KBYesCT
FAILED: [[SimpleTest]]: [MySQL] Invalid PHP syntax in core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php.
[ View ]

Comments

Assigned:Unassigned» YesCT

Title:Copy of [META] Rename Views properties to core standardsIn FieldPluginBase Rename Views properties to core standards
Status:Active» Needs review
StatusFileSize
new5.23 KB
FAILED: [[SimpleTest]]: [MySQL] Invalid PHP syntax in core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php.
[ View ]

Should check other classes that extend FieldPluginBase to see if they were using any of its properties?
If they are, we should rename them in those classes too?

There are a bunch of them
https://api.drupal.org/api/drupal/core%21modules%21views%21lib%21Drupal%...

Some of the name replacements were for "vars"
do they need any different treatment?

I gave the properties doc blocks too. Should we do that in general?
It was difficult to figure out what exactly the descriptions should be.

Ah, #1856630-17: [Change notice] [META] Rename Views methods to core standards mentions vars

Note: The PHP 4 method of declaring a variable with the var keyword is still supported for compatibility reasons (as a synonym for the public keyword).

Status:Needs review» Needs work

The last submitted patch, drupal8.views-module.FieldPluginBase.2052591-2.patch, failed testing.

+++ b/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.phpundefined
@@ -51,22 +51,35 @@
+  protected $fieldAlias = 'unknown';
...
+  protected $aliases = array();

All this variables are used in potentially every subclass. In phpstorm you can rename variables with shift+f6 and rename all usages at the same time. MAGIC

+++ b/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.phpundefined
@@ -51,22 +51,35 @@
+   $additionalFields = array();

This is the php syntax problem. You either need protected or public.

Status:Needs work» Needs review
StatusFileSize
new29.84 KB
new34.23 KB
FAILED: [[SimpleTest]]: [MySQL] 57,680 pass(es), 6 fail(s), and 150 exception(s).
[ View ]

cool.

this is "everything" including comments.
need to check things like the renders.

posting this first, then we will see what it changed too much.

+++ b/core/modules/views/lib/Drupal/views/Plugin/views/row/RowPluginBase.phpundefined
@@ -153,7 +153,7 @@ public function render($row) {
-      '#field_alias' => isset($this->field_alias) ? $this->field_alias : '',
+      '#fieldAlias' => isset($this->field_alias) ? $this->field_alias : '',
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/row/RssFields.phpundefined
@@ -179,7 +179,7 @@ public function render($row) {
-        'field_alias' => isset($this->field_alias) ? $this->field_alias : '',
+        'fieldAlias' => isset($this->field_alias) ? $this->field_alias : '',
+++ b/core/modules/views/views.moduleundefined
@@ -100,7 +100,7 @@ function views_theme($existing, $type, $theme, $path) {
-    'row' => array('view' => NULL, 'options' => NULL, 'row' => NULL, 'field_alias' => NULL),
+    'row' => array('view' => NULL, 'options' => NULL, 'row' => NULL, 'fieldAlias' => NULL),
+++ b/core/modules/views/views.theme.incundefined
@@ -343,8 +343,8 @@ function template_preprocess_views_view_grouping(&$variables) {
+ * $field->fieldAlias says what the raw value in $row will be. Reach it like
+ * this: @code { $row->{$field->fieldAlias} @endcode

these I thought could use a closer look.

Status:Needs review» Needs work

The last submitted patch, drupal8.views-module.FieldPluginBase.2052591-6.patch, failed testing.

Assigned:YesCT» Unassigned
Status:Needs work» Needs review
StatusFileSize
new2.74 KB
new32.75 KB
FAILED: [[SimpleTest]]: [MySQL] 57,177 pass(es), 6 fail(s), and 150 exception(s).
[ View ]
new537.36 KB

I'll be away from the computer for a while, and discussion is going on regarding some of this.
I'll take some notes and unassign in case someone wants to try something.

find-usages-twig.png

based on discussion between @dawehner @Cottser @berdir

"Implementation" http://twig.sensiolabs.org/doc/templates.html#variables
it just lowercases everything and compares, I don't see any conversion between under_score and camelCase https://github.com/fabpot/Twig/blob/master/lib/Twig/Template.php#L403

field_alias to fieldAlias would not match since it would convert fieldAlias to fieldalias

how can I know that the field_alias that's referenced in that twig template is referring to the one from FieldPluginBase?

{{ dump() }} in the template file might give you something useful but making that better is a work in progress over a couple of issues
#1783134: [META] Make it possible to inspect twig variables and get information about objects and render arrays and #1922304: Remove TwigReference objects in favor of a high speed implementation by using NodeVisitors more cleverly

In general though I would be looking at the hook_theme() definition, preprocess function, etc
This is a weird case though :)

views_theme:8?
views_theme: Implement hook_theme(). Register views theming functions. => views_theme($existing, $type, $theme, $path) => http://api.drupal.org/api/function/views_theme/8

the field_alias is part of a $variables array that is used in the foreach to register a theme hook for row style plugins
the @see there says to see template_preprocess_views_view_field()

for this we should leave #field_alias as underscores to be consistent with render API and just do:
isset($this->fieldAlias) ? $this->fieldAlias : '',
that way we would leave views_theme() as is...

If we had a row Twig template then it would get the 'field_alias' variable defined in views_theme()
we still need to update views-view-field though because that is accessing an object property

views_view_field() is just getting the row object, not going through row theming... FieldPluginBase::theme() which is called from StylePluginBase::renderFields()

row plugins do have a field alias
but it is not documented on the RowPluginBase class

it being set in the query method
in RowPluginBase
'#fieldAlias' => isset($this->field_alias) ? $this->field_alias : '',

I think this should document (use?) FieldPluginBase

---
So...
leaving views-view-field.html.twig template with: * data = row[field.field_alias]
And changing to
      '#field_alias' => isset($this->fieldAlias) ? $this->fieldAlias : '',
in RowPluginBase

--
is + * this: @code { $row->{$field->fieldAlias} @endcode
missing a bracket?

The last submitted patch, drupal8.views-module.FieldPluginBase.2052591-9.patch, failed testing.

Issue summary:View changes
Status:Needs work» Needs review
StatusFileSize
new29.96 KB
FAILED: [[SimpleTest]]: [MySQL] 59,508 pass(es), 13 fail(s), and 153 exception(s).
[ View ]
new14.61 KB

Simple Reroll

The last submitted patch, 11: drupal8.views-module.FieldPluginBase.2052591-10.patch, failed testing.

StatusFileSize
new30.81 KB
FAILED: [[SimpleTest]]: [MySQL] 59,477 pass(es), 12 fail(s), and 3 exception(s).
[ View ]
new908 bytes
FAILED: [[SimpleTest]]: [MySQL] Setup environment: Test cancelled by admin prior to completion.
[ View ]

One bug of many cleared.

in DataFieldRow.php there was an outstanding conversion of field_alias to fieldAlias.

Status:Needs review» Needs work

The last submitted patch, 13: interdiff-10-11.patch, failed testing.

The last submitted patch, 13: drupal8.views-module.FieldPluginBase.2052591-11.patch, failed testing.

The last submitted patch, 13: drupal8.views-module.FieldPluginBase.2052591-11.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new31.71 KB
FAILED: [[SimpleTest]]: [MySQL] 59,481 pass(es), 12 fail(s), and 3 exception(s).
[ View ]
new970 bytes

Last patch removed 1 error and 150 exceptions from test.
This patch is expected to remove 1 error!

Hoping someone else might have better luck.

The last submitted patch, 17: drupal8.views-module.FieldPluginBase.2052591-12.patch, failed testing.

Status:Needs review» Needs work

I've changed the status of the ticket back to "needs work".