SQL form for views should check query_tags value

Created on 17 September 2019, almost 5 years ago
Updated 22 May 2024, 4 months ago

I had this issue, that I could not no longer open view "Query settings" to change its "Distinct" property - had to change it, because after one of last updates, it could not query properly distinct rows of Articles, but that is not the point.

Turns out, for some reason, Drupal had stored NULL inside "query_tags" value, thus irrecoverably disabling chance to fix it - Drupal could not render form if it gets unexpected value.

Code https://git.drupalcode.org/project/drupal/blob/8.7.x/core/modules/views/...

It assumes, that

$this->options['query_tags']

will always be an array, but in my case, after var dump, it was NULL - I have no idea why, but it should not break whole interface from being able to fix that NULL.

I propose to mitigate issues with the value, by changing (line 320) from

'#default_value' => implode(', ', $this->options['query_tags']),

to

'#default_value' => is_array($this->options['query_tags']) ? implode(', ', $this->options['query_tags']) : '',
πŸ› Bug report
Status

Closed: cannot reproduce

Version

11.0 πŸ”₯

Component
ViewsΒ  β†’

Last updated about 12 hours ago

Created by

πŸ‡±πŸ‡»Latvia Deele Riga

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡³πŸ‡ΏNew Zealand quietone New Zealand

    @Deele Thank you for reporting this problem and proposing a fix. We rely on issue reports like this one to resolve bugs and improve Drupal core.

    For the suggested change to be added we need to know how to reproduce the problem. If you can provide complete steps to reproduce the issue β†’ (starting from "Install Drupal core") then we can take this further.

    Since we need more information to move forward with this issue, I am setting the status at Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

  • Status changed to Closed: cannot reproduce 4 months ago
  • πŸ‡¦πŸ‡ΊAustralia pameeela

    Given there was no further info provided, I'm going to close this issue. If anyone feels it should not be closed, please update the issue summary with specific steps to reproduce this.

Production build 0.71.5 2024