Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Conversation

@splitbrain
Copy link

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 $split path 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.

Frederic Massart and others added 5 commits February 20, 2014 12:03
* pr/539:
  Test demonstrating issue with imports and variables
The leafo#539 PR contained a trailing white space in the output
test file which made the test always fail.
When dynamically importing a file (using a variable for the import path)
the parser will throw an exception about the variable not being defined,
even though it clearly is.

This problem was first reported at dokuwiki/dokuwiki#2260
This fixes the problem described at dokuwiki/dokuwiki#2260 but may not
be the most elegant solution.
@MarcusSchwarz MarcusSchwarz merged commit 5ce15c3 into MarcusSchwarz:master May 28, 2018
@MarcusSchwarz
Copy link
Owner

merged, thank you!

MarcusSchwarz pushed a commit that referenced this pull request May 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inline variable does not overwrite @import variable

2 participants