- π¦πΉAustria nofue
First: no, I don't have any custom code except some twig within the view I'm using. I'm not trying any array offset whatsoever, I'm just using a view which works in preview as an embedded view in the footer of another view.
The issue is completely unrelated to the kind of view. I get the same odd result with page views as well as block views or entity reference views.
To repeat myself:
I created a view vrh_pj_nextid
which is embedded in another views footer section
to display the next ID a project should be given.That view vrh_pj_next id is an entity reference list with a hidden field, pj-id, which gets used in a global text field in a twig statement to increment the number returned by one:
{% set next = field_pj_id | trim %} {{ next+1 }}
The number of results to be displayed is limited to one, and the sorting is set to pj_id, descending.
In the preview, this view shows exactly one result value, the highest pj_id in the database + 1
The views using that query in the footer showed exactly the same result: ONE result, just ONE -- today it's 1253Now, since upgrading to 9.5.1, all the views using that view vrh_pj_nextid
show ALL the values in the database +1. A list, instead of just one value, as restricted in the basic vrh_pj_nextid view. Today, this very list shows
1253 1252 1251 1250 β¦ beneath the view which shows single items with an id of pj_idAs a workaround, I created a simple drop down showing the values of the vrh_pj_nextid view, and sure enough, the drop down is also populated with all the values in the database +1 instead only the highest value + 1.
I also tried Aggregation=ON,
What else shall I provide?
It's as simple like this:
Create some content type holding a single integer number.
Populate that view with some records: 1 - 2 - 5 - 9 - 19 - 2002 should suffice
create a view for this content type, only showing that very field, ordered descending
LIMIT this view to a single result to a single value in Page Navigation OR use aggregation - MAX to get the highest value so far in this fieldMake sure you see exactly ONE value as a result, the highest value (2002 in my example) in the database.
Now use this view as an attached view in the footer of another view.
What do you see?I get a list of all the values in the database, 1259192002
And this behaviour begun with 9.5.1, and it's still in 9.5.2
- π¦πΉAustria nofue
Or, let's put the issue the other way around:
How to get the highest value of a field of given content type as a result in views, and showing that very result beneath another view.
The option which should do it, is using aggregation and using the MAX function with the field you want to see the maximum from.
I did this, and it works nicely.
BUT once I put this view into another view's footer as an attached view, I get the whole list of values.
This also happened with 9.5.0, iirc.I came up with a workaround, using a regular query, sorting results descending, and showing only the topmost result using the page navigation. This worked in the stand alone case as in the embedded case, hence I used it from 9.5.0 on. But with 9.5.1 BOTH options are broken β¦
See attached screen shots. vrh-pj-nextid.jpg shows what is expected (and as it works). vrh-pj-list.jpg shows how the result looks once the vrh-pj-nextid view is attached to the footer of vrh-pj-list since D9.5.1
- π¦πΉAustria nofue
After some more hours on this oddity, I came up with no solution, but one more finding :)
It occurred to me that "page navigation" actually means PAGE navigation since D9.5.1.
I.e. entering "1" for the number of allowed rows in the result, only 1 line (in my case the next ID to use) would be shown, if, and only if the view would be a page view.However, when duplicating my entity reference view to a page view and calling that view using its URL, the same odd "all lines of the database" behaviour could be spotted.
To add to the list, the following error occurred today, after running some composer upgrade -W
Warning: Undefined array key "in" in Drupal\views\Plugin\views\filter\NumericFilter->adminSummary() (line 389 of core/modules/views/src/Plugin/views/filter/NumericFilter.php).
I can't make much sense from this, but I hope some coder gets an idea as what's going on here.
Hi,
I got the exactly same issue as nofue ! It's very annoying because I don't find any workaround.
I posted an issue on "Views field view" module, but no more answer. https://www.drupal.org/project/views_field_view/issues/3352876 π Paging : item limitation is not propagate Active
It seems that the last update on this module was not involved (I tried a downgrade).During my investigation, I saw that final view (that embedded the first one) receive an array with all results, and not just the page 1 as expected. So logically the 2nd view display the view field with all the items. It probably confirme that the change in more related to the core than to the views field view module.
The way how the paging / display limitation may have changed and it's not made at the query level but on render level. Has someone knowledges on that? It's not easy to investigate more into this complex module ^^
Thanks for any help
Cyril- π¦πΊAustralia pameeela
I can appreciate how frustrating this issue is, but it's still not clear how to reproduce it. There is a lot of info provided, but the best way to get assistance is to provide *very* specific steps to reproduce β the issue, starting with "Install Drupal" and listing the exact view configuration required.
I created a view vrh_pj_nextid
which is embedded in another views footer section
to display the next ID a project should be given.It may seem obvious to you what this means but I honestly have no idea.
If more info isn't provided within 3 months, this issue may be closed.