Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kenianbei’s picture

Assigned: Unassigned » kenianbei
kenianbei’s picture

I've changed most of these, but I'm not sure if the module_invoke hook name should also be changed:

<?php
$module_handler->invoke($base, 'views_pre_render', array($this));
?>

to

<?php
$module_handler->invoke($base, 'views_preRender', array($this));
?>
kenianbei’s picture

Assigned: kenianbei » Unassigned
Status: Active » Needs review
FileSize
12.8 KB

I think I've found most/all of the pre_render method calls... I left the module invoke to use views_pre_render.

Status: Needs review » Needs work

The last submitted patch, drupal-rename-pre-render-2003366-3.patch, failed testing.

heddn’s picture

Status: Needs work » Needs review
mari3.14’s picture

aspilicious’s picture

Status: Needs review » Needs work

All these function should start with "public"
==> public function preRender

Should be good to go when thats fixed :)
Thnx for working on this

somepal’s picture

Status: Needs work » Needs review
FileSize
14.41 KB

since its unassigned, taking a look at this, hope @kenianbei wouldn't mind.
@aspilicious so here's the patch.

heddn’s picture

Status: Needs work » Needs review
+++ b/core/modules/system/lib/Drupal/system/Plugin/views/field/BulkFormBase.phpundefined
@@ -24,10 +24,10 @@ public function render($values) {
+   * Overrides \Drupal\views\Plugin\views\Plugin\field\FieldPluginBase::preRender().

+++ b/core/modules/system/lib/Drupal/system/Plugin/views/row/EntityRow.phpundefined
@@ -111,10 +111,10 @@ public function summaryTitle() {
+   * Overrides Drupal\views\Plugin\views\row\RowPluginBase::preRender().
+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/views/row/EntityReference.phpundefined
@@ -47,15 +47,15 @@ public function buildOptionsForm(&$form, &$form_state) {
+   * Overrides \Drupal\views\Plugin\views\row\Fields::preRender().

Should really use @inheritdoc.

Also, could you provide an interdiff?

heddn’s picture

Status: Needs review » Needs work
somepal’s picture

@heddn thank you for pointing out, we have @inheritdoc now.

kenianbei’s picture

@Joe9: thanks for taking this, got caught up with work and haven't had time to follow through.

aspilicious’s picture

Status: Needs review » Needs work

They need public access modifier

sillygwailo’s picture

Status: Needs work » Needs review
FileSize
14.78 KB

Re-roled with public on all the function declarations. Also fixed a typo (preEender) that snuck into the latest patch.

Status: Needs review » Needs work

The last submitted patch, 2003366_rename-pre_render.patch, failed testing.

pcambra’s picture

Status: Needs work » Needs review
FileSize
1.15 KB
15.93 KB

Here's a rerroll with some minor changes, let's see if this is green now.

Status: Needs review » Needs work

The last submitted patch, 2003366_rename-pre_render-16.patch, failed testing.

sillygwailo’s picture

Status: Needs work » Needs review
FileSize
725 bytes
15.94 KB

Same patch as #16 except with public in ContextualLinks.php (re-rolled against 8.x).

damiankloip’s picture

+++ b/core/modules/views/lib/Drupal/views/Plugin/views/field/Custom.phpundefined
@@ -47,21 +47,21 @@ function render($values) {
+  public function preRender(&$values) {
+    if (isset($values['alter'])) {
+      $values['text'] = $values['alter']['text'];
+      $values['help'] = $values['alter']['help'];
+      unset($values['alter']['text']);
+      unset($values['alter']['help']);

Why this change?

pcambra’s picture

For what I've seen, we might not have control on what's coming in $values, if you check the test_dropbutton view, we've got a custom text in there, which will be pre rendered by the preRender method displayed in #19, but at that point $values has an array of all the nodes being rendered, I guess because the custom field is being rewritten to use the nid?

nothing:
          id: nothing
          table: views
          field: nothing
          plugin_id: custom
          relationship: none
          group_type: group
          admin_label: ''
          label: 'Custom text'
          exclude: '0'
          alter:
            alter_text: '1'
            text: 'Custom Text'
            make_link: '1'
            path: 'node/[nid]'
heddn’s picture

Status: Needs review » Needs work

Let's discuss the changes in #18 in a follow-up. The scope of this issue is to simply rename the function. Anything else should come elsewhere.

sillygwailo’s picture

Here's the same patch as #14, but with public on ContextualLinks.php (also re-rolled against 8.x).

pcambra’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 2003366_rename-pre_render.patch, failed testing.

heddn’s picture

Let's see if this passes.

heddn’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, drupal-viewsRename-pre_render-2003366-25.patch, failed testing.

joelpittet’s picture

+++ b/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php
@@ -1090,7 +1090,7 @@ public function adminSummary() {
-  function pre_render(&$values) { }

Custom class from Drupal\views\Plugin\views\field\Custom already defines a preRender method that isn't matching the signature of the new one FieldPluginBase (ie referenced and not returning values) and is used by it's buildOptionsForm. Not sure the best solution for this, though I am sure someone will know:)

YesCT’s picture

this renamed the pre-existing preRender in Custom to preRenderCustom

and then needed a reroll.

it was a clean merge with 8.x with no conflicts.

grepping to see if other preRender's would need to be renamed..
ag "extends Custom "
gives nothing, so this should be ok.

damiankloip’s picture

Cool, but I think we should call the Custom implementation of preRender preRenderCustomForm. As this is just a pre render callback for the form, and not for the actual handler result processing.

aspilicious’s picture

Status: Needs review » Reviewed & tested by the community

done!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 116f0a3 and pushed to 8.x. Thanks!

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

quietone’s picture