I copy-pasted an update hook from module A into module B's b.post_update.php, as a_my_post_update(), and the update system found it and didn't mind and reported it as belonging to module A.
It should probably throw an exception instead.
I copy-pasted an update hook from module A into module B's b.post_update.php, as a_my_post_update(), and the update system found it and didn't mind and reported it as belonging to module A.
It should probably throw an exception instead.
Comments
Comment #2
joachim commentedProbably not easy to fix, since getAvailableUpdateFunctions() just looks at get_defined_functions() rather than look in each file.
Comment #8
borisson_Looks like this would be possible with Reflection (https://www.php.net/manual/en/reflectionfunctionabstract.getfilename.php)
Since this is a developer experience improvement, I'm not sure if this is a bug or a task, this feels more like a task.
Comment #11
nicxvan commentedComment #12
nicxvan commentedThis is how hooks worked in procedural land.
We intentionally preserved that with attributes (though it's under discussion)
I would presume we'd preserve that as well if these mive to oop too.
This might not belong with the extension system, but sure exactly where it should be though.
Comment #13
nicxvan commentedI'm going to close this as works as designed.
While it might be kind of confusing it is how it works.