Problem/Motivation

When using Views Aggregator, something about the pager causes attachments like Data export to break the view. It appears to incorrectly formulate the route to the data export page, missing the view machine name.

Symfony\Component\Routing\Exception\RouteNotFoundException: Route "view..data_export_1" does not exist. in Drupal\Core\Routing\RouteProvider->getRouteByName() (line 206 of core/lib/Drupal/Core/Routing/RouteProvider.php).

Steps to reproduce

  1. Create a view with a page. Initially have the pager/limit set to 0 (all items), display as a Table with aggregation options. (I didn't need to set any aggregation options, can reproduce just using this display style for the view.) Display whatever you want, the default title field is fine
  2. Add another display that is a 'Data export'. Attach it to the page, and put in minimal export settings so that you can save it.
  3. Go back to the 'page' view, may need to clear cache if needed. Observe that the preview works (or check the real view).
  4. Edit the page and change pager settings to "mini" or "full" pager to limit the options. Observe that the preview no longer refreshes and the view page will not load (error).

For posterity, I switched a couple settings around to make sure it was exactly this combination that causes the problem.

  • If the pager shows all, or a limited number of results without a pager, it works.
  • If the page displays as a Table, it works.
  • Error is the same with or without use of filters, sorts, etc.
CommentFileSizeAuthor
#8 views_aggregator.patch524 bytesyonailo
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

TLWatson created an issue. See original summary.

jdhildeb’s picture

I hit this same issue.

I found that it is related to the "Column aggregation row applies to" setting within Format -> Settings.

If you set "Column aggregation row applies to" to "the page shown" then the error goes away. Switching it back to "the entire result set" causes the error to occur.

tr’s picture

Version: 2.0.x-dev » 2.1.x-dev
tr’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: -export, -data export, -pager

Is this related to #3439536: Exposed filters aggregation (regression?) and is this problem fixed by the proposed patch in that issue?

daveonaka’s picture

I ran into a similar error after update to version 2.1.0 - an existing View with aggregator table had a linked Views Data Export. After update, the Aggregator Plus page did not display and the error message about "route does not exist" appeared. It looks like the database update (after running Drush database update) wipes the path?

tr’s picture

The update function did not make any database changes - it only changed the datatypes of three configuration variables used internally to views_aggregator. Specifically, routes and all other configuration variables were left unchanged. Only views that used views_aggregator were changed, and only the displays on those views that used these three configuration variables

I would try to re-save your view, and clear your caches, but I don't see how anything the update did could have affected a route anywhere on your site.

What route in particular is it missing? Is it possible for you to compare an export of the old view and the new view and post that here so I can see what changed?

yonailo’s picture

I am hitting this issue too, the patch of issue 3439536 does not fix it.

As stated in the original PR, the issue appears when using a pager.

Below is a patch that seems to fix the issue for me.

yonailo’s picture

StatusFileSize
new524 bytes
dieterholvoet’s picture

Title: Does not work with data export + paging » Does not work with data aggregation + paging
Project: Views Aggregator Plus » Views data export
Version: 2.1.x-dev » 8.x-2.x-dev
Status: Postponed (maintainer needs more info) » Active

Hitting the same issue. It's happening because Drupal\views_aggregator\Plugin\views\style\Table::preRender() creates a duplicate and executes it without saving. Down the line, in Drupal\views_data_export\Plugin\views\display\DataExport::attachTo(), $view->getUrl() is called and fails because the attached view doesn't have an ID yet, because it is new and unsaved.

I'm able to fix this in Views data export by calling isNew() before trying to generate an url. I believe that's the way to go, so I'm moving this issue to that project.

dieterholvoet’s picture

Status: Active » Needs review

steven jones made their first commit to this issue’s fork.

steven jones’s picture

There's actually a method on \Drupal\views\ViewExecutable that tells us if there's a URL, I wonder if that's what we need to check here?

@dieterholvoet are you able to test this MR I'm about to open please?

steven jones’s picture

Version: 8.x-2.x-dev » 8.x-1.x-dev
tlwatson’s picture

I was able to test your MR in my issue case - it works! I don't see any regressions in my other export views either.

vladimiraus’s picture

Status: Needs review » Needs work

Testing (Drupal 10 and latest version of module) after getting

Error: Call to undefined method Drupal\views\Plugin\views\style\Table::attachTo() in Drupal\views_data_export\Plugin\views\display\DataExport->attachTo() (line 562 of modules/contrib/views_data_export/src/Plugin/views/display/DataExport.php).

After applying MR69 I'm getting

Error: Call to undefined method Drupal\views\Plugin\views\style\Table::getFormats() in Drupal\rest\Plugin\views\display\RestExport->collectRoutes() (line 353 of core/modules/rest/src/Plugin/views/display/RestExport.php).

vladimiraus’s picture

Status: Needs work » Reviewed & tested by the community
steven jones’s picture

Related issues: +#3552653: Release 8.x-1.7

  • steven jones committed 3b00c840 on 8.x-1.x
    [#3447012] fix: Does not work with data aggregation + paging
    
    By:...
steven jones’s picture

Status: Reviewed & tested by the community » Fixed

Thanks everyone!

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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