- Issue created by @ceonizm
- Merge request !7330Issue #3306390 by poker10, catch, Fabianx, pwolanin, rvtraveller: [D7]... → (Closed) created by ceonizm
- 🇬🇧United Kingdom aaron.ferris
I think you'll need to point at the 7.x branch, at the moment the MR is pointing at 11.x.
- Merge request !7332strengthen drupal_get_path function to avoid deprecated error when passing... → (Open) created by ceonizm
- last update
9 months ago 2,179 pass - 🇫🇷France ceonizm Marseille
Thanks you @aaron.ferris : my bad I hadn't noticed.
I've created a new one it should be ok now. - Status changed to Needs review
9 months ago 7:47am 5 April 2024 - First commit to issue fork.
- last update
9 months ago 2,179 pass - Merge request !7447Issue #3438308: dirname(): Passing null to parameter #1 ($path) of type string is deprecated in drupal_get_path() → (Open) created by apaderno
- last update
9 months ago 2,179 pass - 🇮🇹Italy apaderno Brescia, 🇮🇹
apaderno → changed the visibility of the branch 3438308-avoid-deprecated-function to hidden.
- 🇬🇧United Kingdom robcarr Perthshire, Scotland
I tried the MR and worked fine for me. +1 for RTBC
- 🇸🇰Slovakia poker10
Thanks for working on this! I understand that it is inconvenient, if the site runs into similar deprecations. However on the other hand, the core approach of not "babysitting" broken (contrib/custom) code helped to discover issues in specific modules and fix them. If we add a proposed check here, there will be no sign of any problem, even if the deprecation message is caused by a serious condition.
I agree that the deprecation message itself if not helpful and does not help to identify a problem, but it is still a sign of a problem. Commonly, the
drupal_get_path()
is not used to check if something exists, but most of the time (in core), the output is used directly, as it is supposed to return the path (if everything works as expected). But I also agree, that given this return parameter documentation:* @return
* The path to the requested item or an empty string if the item is not found.it should probably work and return the empty string, instead of any errors or so.
That said, I am still not sure if we should commit this, so adding a tag for a review from another D7 maintainer to discuss. If we decide to go forward, maybe we should consider making the fix even simpler, by just casting the return value from
drupal_get_filename
to string. Something like:return dirname((string) drupal_get_filename($type, $name));
- 🇬🇧United Kingdom mcdruid 🇬🇧🇪🇺
I generally agree with the "core doesn't babysit bad code" approach, but this seems like a simple change which aligns the behaviour of the code with how the docs/comments say it behaves (..and avoids noise in logs when PHP is updated).
Thanks everyone!
- Status changed to Fixed
7 days ago 5:19pm 17 December 2024 Automatically closed - issue fixed for 2 weeks with no activity.