- Issue created by @colan
- First commit to issue fork.
- ๐ฎ๐ณIndia kalpanajaiswal
Drupal Views core was built assuming Sql::$orderby is public.
If query plugin replaces the default one and doesnโt declare it (or keeps it protected), this line fails:$this->view->query->orderby
in ExposedFormPluginBase::query() (line 160)
Problem:
protected array $orderby;
Core Views expects this to be public because it accesses it directly from outside (e.g., in ExposedFormPluginBase::query()).Fix:
public array $orderby = [];
Also initialize it to an empty array to avoid undefined property errors when using null coalescing: foreach ($this->orderby ?? []).$fields should be public
Core plugins may access $fields too, e.g., during rendering or sorting.public array $fields = []
- ๐จ๐ฆCanada colan Toronto ๐จ๐ฆ
Explanation & code make sense, but I haven't tested it. Thanks!
- ๐ซ๐ทFrance guignonv Montpellier
Thanks kalpanajaiswal, I checked what you pointed out and the changes make sense (and not a big deal). Merged.
@Colan if you can test and confirm the fix, I let you close the issue. - ๐จ๐ฆCanada colan Toronto ๐จ๐ฆ
I'm not in a good position to test right now so let's just mark it fixed, and then reopen if there are problems.
Automatically closed - issue fixed for 2 weeks with no activity.