Hello,

I've just noticed a "bug" when you have multiple exports on the same view.
If you attach several exports to the same view, you will have multiple buttons with always the same name because it's based only on the view name whearas it should be based on the display name in order to differenciate the buttons.
You still have a different URL for each button and the browser will show you the URL but it is not user friendly at all.

I've done a patch in order to change the button name with the display name and not the view name.

Comments

phjou created an issue. See original summary.

phjou’s picture

phjou’s picture

Status: Active » Needs review
acrollet’s picture

There's a small code style issue, space needed after the if:

if(!empty($displays[$this->display['id']])) {

However I've used this patch, it does what it says on the tin, I'd consider it RTBC with the style fix.

phjou’s picture

Thanks for you review, there is a new patch without the syntax error.

acrollet’s picture

Status: Needs review » Reviewed & tested by the community

awesomesauce

  • jhedstrom committed aa8941d on 8.x-1.x authored by phjou
    Issue #2905558 by phjou, acrollet: Export button title should be based...
jhedstrom’s picture

Status: Reviewed & tested by the community » Fixed

Thanks! Sorry for the delay!

Status: Fixed » Closed (fixed)

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

dunebl’s picture

I don't understand... this patch is committed but I still get the same button title for all exports.
Am I missing something?
The twig file of the export button looks like:

<a href="{{ url }}"{{ attributes.addClass('feed-icon') }}>
  {{ 'Download @format'|t({'@format': format}) }}
</a>

I don' see any title in it (and looking at the preprocess hook, the variable doesn't contains any title too)

nikita_tt’s picture

I agree with #10. This patch does not make any sense.

letiendat1002’s picture

Hey #10, #11. I found a solution to your problem, it's on another issue https://www.drupal.org/project/views_data_export/issues/3200051

I used a patch on comment #7 for version 1.4 / Drupal 10; there's also a patch for Drupal 11.