- Merge request !2Issue #3251757: Error: Call to a member function getOption() on null → (Merged) created by v1nk
- 🇵🇱Poland alorenc Wolsztyn, 🇵🇱
My suggestion is to check an interface similar to
https://git.drupalcode.org/project/drupal/-/blob/11.x/core/lib/Drupal/Co... - Assigned to alorenc
- Status changed to Active
about 1 year ago 1:31pm 16 April 2024 - 🇵🇱Poland alorenc Wolsztyn, 🇵🇱
Updated #11 patch,
* checked if url implements Drupal\Core\Url,
* added a simple test, - Issue was unassigned.
- Status changed to Needs review
about 1 year ago 1:56pm 16 April 2024 - 🇮🇳India divya.sejekan
This patch work for me #15 -> menu_link_destination-fatal_error_when-no_url-3251757-15.patch
But @alorenc
i can see some error in the site after applying patchKeeping in in review for the error message
- 🇭🇺Hungary huzooka Hungary 🇭🇺🇪🇺
I dug into the problem and I don't think there is any issue with this module. The docblock of the Link render element declares that
#url
must be a\Drupal\Core\Url
object - so Menu Link Destination can assume that the value at this key is a Url object.- Based on #10, the reported issue is caused by Admin Toolbar Extra Tools (link renderable array without
#url
). - @alorenc had another case where the error was slightly different (calling getOption() on bool) - and that is casued by a link renderable having
#url
key set toFALSE
. This link is created by Webform; see 🐛 Webform might create invalid link renderable arrays on submission list. Needs review
I propose to close this issue, referring the corresponding bug of the contrib modules. Maybe the module could check if the link renderable array it is processing is a valid and log an error if it isn't... But wouldn't that be overkill? (Imho it wold be.)
- Based on #10, the reported issue is caused by Admin Toolbar Extra Tools (link renderable array without
- 🇵🇱Poland alorenc Wolsztyn, 🇵🇱
correct, the link element describes URL property as \Drupal\Core\Url but at the same time it checks if it is URL
https://git.drupalcode.org/project/drupal/-/blob/11.x/core/lib/Drupal/Co...I do not see any reason why we can not do the same, it will be simply more resistant to mistakes.
- Status changed to RTBC
11 months ago 5:01pm 30 May 2024 -
claudiu.cristea →
committed fde50da3 on 1.x authored by
v1nk →
Issue #3251757 by v1nk, alorenc, kerasai, claudiu.cristea, huzooka:...
-
claudiu.cristea →
committed fde50da3 on 1.x authored by
v1nk →
- Status changed to Fixed
11 months ago 5:02pm 30 May 2024 Automatically closed - issue fixed for 2 weeks with no activity.