By chance PHPStorm just showed me that /core\modules\views\lib\Drupal\views\Plugin\views\relationship\GroupwiseMax.php:129
calls protected properties 'base_table' and 'display' on Drupal\views\Entity\View. get() method should be used instead.

Comments

Anonymous’s picture

Issue summary: View changes
andypost’s picture

Version: 8.0-alpha10 » 8.x-dev
Status: Active » Needs review
Issue tags: +VDC, +Needs tests
StatusFileSize
new1.34 KB

Not sure about @todo and type => tag, but the patch at least allows open settings form

PS: Faced in #1498660: Refactor taxonomy entity properties to multilingual

andypost’s picture

StatusFileSize
new2.4 KB
new2.55 KB

a bit more fixes

PS: no idea how to write test

Anonymous’s picture

not everything needs a test.

alexpott’s picture

@ivanjaros: yes not everything needs a test but something that exposes a list of views to users does.

alexpott’s picture

Status: Needs review » Needs work

Oh and recreating this error is easy.

  1. Create a view on taxonomy terms
  2. Add a relationship to "Representative node" and you'll never be able to edit that relationship because of this bug. Views UI's js will hide the bug if you go to admin/structure/views/nojs/handler/VIEW_ID/default/relationship/tid_representative you'll see the bug plain as day.
andypost’s picture

There's 2 views tests named RelationshipRepresentativeNodeTest
they uses test_groupwise_term and test_groupwise_user views

alexpott’s picture

re #7 but the tests never visit the configuration forms so we don;t have test coverage of the bug.

jhodgdon’s picture

Priority: Normal » Major

This is a critical issue, or at least Major. If you go to Views UI and try to view the settings for a GroupwiseMax relationship field (such as Representative Node for a Taxonomy Term view), you get a fatal PHP error.

And yes it needs a test.

marthinal’s picture

Assigned: Unassigned » marthinal
Issue tags: +Amsterdam2014

Working on the test.

marthinal’s picture

Status: Needs work » Needs review
StatusFileSize
new1.47 KB
new4.09 KB

The test "test_groupwise_term_ui" basically is a copy of "test_groupwise_term".

This is a first attempt :) . There's an Exception when we apply the changes. (Uncaught PHP Exception Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: "You have requested a non-existent service "cache.views_results"." at /Users/josemanuelrodriguez/workspace/drupal8/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Container.php line 303)

marthinal’s picture

StatusFileSize
new6.17 KB

Missing the view, sorry.

The last submitted patch, 11: 2239227-11-only-test.patch, failed testing.

The last submitted patch, 11: 2239227-11.patch, failed testing.

marthinal’s picture

About the Exception (#11) we can avoid it removing the line "\Drupal::cache('views_results')->delete($cid);"

So we need to test this too.

I was talking about this bug with tstoeckler and we are not sure if we really need it...

marthinal’s picture

StatusFileSize
new2.92 KB
new1.66 KB
new7.32 KB

I was talking with dawhener and let's use "cache.data" instead.

The last submitted patch, 16: 2239227-16-only-test.patch, failed testing.

marthinal’s picture

StatusFileSize
new2.06 KB
new8.64 KB

Added test for the cache.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs tests

Awesome!

  1. +++ b/core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php
    @@ -122,20 +123,14 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
    -    $all_views = Views::getAllViews();
    -    foreach ($all_views as $view) {
    +    foreach (Views::getAllViews() as $view) {
    

    +1

  2. +++ b/core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php
    @@ -122,20 +123,14 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
    -        if ($view->type == 'Default') {
    -          $views[t('Default Views')][$view->storage->id()] = $view->storage->id();
    -        }
    -        else {
    -          $views[t('Existing Views')][$view->storage->id()] = $view->storage->id();
    -        }
    

    oh wow, this is damn old code!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 2c11d0e and pushed to 8.0.x. Thanks!

  • alexpott committed 2c11d0e on 8.0.x
    Issue #2239227 by marthinal, andypost | ivanjaros: Fixed Views...

Status: Fixed » Closed (fixed)

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