Closed aschempp closed 7 months ago
Hm, how exactly can I reproduce this? Because if the target folder in vendor/
does not exist anymore, the symlink will be removed anyway and thus this error should never really occur?
I would try to manually create a symlink in system/modules and then remove the source. Then run contao:setup
to rebuild the bundles. Without this change, the build process should fail with e message about the module not being found.
But how would this happen in the real world?
I think in my case Composer tried to uninstall an extension but the contao-community-alliance/composer-plugin
did not run successfully to remove the symlink. I guess Composer removed one extension but failed on the next one, so the plugin did not run at all (because Composer aborted the process). Maybe even because of a 30sec limit.
In any case the is_dir
check works 👍.
Thank you @aschempp.
If there is a symlink in
system/modules
to avedor/...
folder that no longer exists, the plugin currently tries to create aModuleBundle
for it, which fails because the source cannot be found. I think we can safely skip broken symlinks when loading modules.Maybe @fritzmg can manually test if this also works on Windows? I manually created three folders in
system/modules
, a regular one, a working symlink and a broken symlink, andis_dir
"correctly" returnedfalse
on the broken symlink. I hope Windows does that too? 😅