Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The taxonomy_vocabulary_load() function returns NULL on non-existing vocabularies, where it should return FALSE.
As a consequence, pretty errors are displayed when calling /admin/content/taxonomy/xxx
on a non existing vocabulary.
Comment | File | Size | Author |
---|---|---|---|
#14 | taxonomy-ret-false-277214-14.patch | 1.03 KB | pwolanin |
#5 | taxonomy.module.patch | 938 bytes | lilou |
#4 | drop.patch | 488 bytes | lilou |
#2 | drop.patch | 492 bytes | dawehner |
Comments
Comment #1
Damien Tournoud CreditAttribution: Damien Tournoud commentedRegistered this as DROP task #107, maybe other menu loaders don't properly return FALSE.
Comment #2
dawehnerhere is the patch
for this small issue // i will look for more things like this tomorrow morning
Comment #3
pwolanin CreditAttribution: pwolanin commenteduse
FALSE
Comment #4
lilou CreditAttribution: lilou commentedComment #5
lilou CreditAttribution: lilou commented+doxygen
Comment #6
Damien Tournoud CreditAttribution: Damien Tournoud commentedLooks great, thank you.
Can we check that all other _load() functions correctly return FALSE?
Comment #7
lilou CreditAttribution: lilou commentedI check all
_load()
function and I haven't findNULL
return.Comment #8
Damien Tournoud CreditAttribution: Damien Tournoud commentedOk, so this looks ready to go in.
Comment #9
Damien Tournoud CreditAttribution: Damien Tournoud commentedBy the way, thanks lilou.
Comment #10
Dries CreditAttribution: Dries commentedIs checking the return value of _load() functions something we can write a test for?
Comment #11
Damien Tournoud CreditAttribution: Damien Tournoud commented@Dries: we need to think a bit about that.
With static code analysis, it would be easy to cover all cases. On our testing framework, we could just call each _load function with a dummy value (NULL, for example) and verify that FALSE is returned. That's not perfect but it can provide a safety net for future regressions. I'll check if that's possible / easy to do.
Comment #12
Dries CreditAttribution: Dries commentedI've committed this to CVS HEAD. Should probably be back-ported to DRUPAL-6.
Comment #13
pwolanin CreditAttribution: pwolanin commentedstill need to go to D6
Comment #14
pwolanin CreditAttribution: pwolanin commentedPatch needed to be re-rolled from the drupal root dir, but applies and works.
Comment #15
Gábor HojtsyLooks good, thanks, committed.
Comment #16
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.