This repository was archived by the owner on Aug 12, 2025. It is now read-only.
Fix dynamic imports #14
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The problem this PR tries to fix was reported at dokuwiki/dokuwiki#2260 - when trying to import files based on a variable, the Compiler class will throw an exception about the variable not being defined even though that not being the case.
The problem was introduced in leafo#548 by @DannyvdSluijs which fixed leafo#302
From what I understand, the PR changed the order of how two sets of properties are joined together, moving the variables behind the actual import resolution and thus triggering the "not defined" error. My patch basically duplicates the variables to have one set available before and one after the fact.
To avoid breaking leafo#302 again, I applied (and fixed) the test proposed in leafo#539
I assume my fix is not ideal and I do not know when the
$splitpath is actually used and if my fix works properly there. Would be great if someone with more knowledge about the library could have a look.This PR also contains a test for the problem fixed in a separate commit, which should make it easier to test possible alternative solutions.