- Issue created by @dpacassi
- Merge request !46Issue #3391307 by dpacassi: Error: Call to a member function hasOption() on null โ (Merged) created by dpacassi
- ๐จ๐ญSwitzerland dpacassi Zรผrich, Switzerland
Created a MR, see: https://git.drupalcode.org/project/better_exposed_filters/-/merge_reques...
Also attaching the current diff as a patch file. - Status changed to Needs review
about 1 year ago 12:34pm 3 October 2023 - ๐บ๐ธUnited States hyperlinked San Jose, CA
I've confirmed that is indeed a problem and can also confirm that the patch works against the 6.0.3 build. In my case, this bug happened because I needed to execute a View programmatically very very very eary in the request process to evaluate whether the view should be rendered or bypassed.
At such an early phase of the request process, the route object has not been built yet so if the view being executed uses Better Exposed Filters, the route object won't be available.
I don't understand the exact mechanics, but executing the default view programmatically worked fine. It's only if I set a current display for the View that I would run into this error where Better Exposed Filters tries to access hasOption() on a null route object.
In my case and in the case of this reported issue, the View is only being executed and won't be rendered to the user so it's inconsequential to bypass the hasOption() call.
- Status changed to RTBC
10 months ago 11:27am 4 March 2024 - First commit to issue fork.
-
smustgrave โ
committed ae2d671f on 6.0.x authored by
dpacassi โ
Issue #3391307 by dpacassi: Error: Call to a member function hasOption...
-
smustgrave โ
committed ae2d671f on 6.0.x authored by
dpacassi โ
- Status changed to Fixed
9 months ago 8:12pm 10 April 2024 Automatically closed - issue fixed for 2 weeks with no activity.