Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requirements::clear() does not clear Requirements_Backend->combine_files #2995

Closed
Zauberfisch opened this issue Mar 31, 2014 · 4 comments
Closed

Comments

@Zauberfisch
Copy link
Contributor

the following code:

    Requirements::combine_files('test1.js', array(
        THIRDPARTY_DIR . '/jquery/jquery.min.js',
        THIRDPARTY_DIR . '/jquery-entwine/dist/jquery.entwine-dist.js',
    ));
    Requirements::clear();
    Requirements::combine_files('test2.js', array(
        THIRDPARTY_DIR . '/jquery/jquery.min.js',
        THIRDPARTY_DIR . '/jquery-entwine/dist/jquery.entwine-dist.js',
    ));

currently results in the error:

Requirements_Backend::combine_files(): Already included files framework/thirdparty/jquery/jquery.min.js,framework/thirdparty/jquery-entwine/dist/jquery.entwine-dist.js in combined file 'test1.js'

But should in fact work.
The fix should be rather easy, I think we only need to change Requirements::clear() to also clear Requirements_Backend->combine_files.

(This test case might look silly, but there is a valid use-case for wanting to include a file into multiple combined files.
lets assume we have a site that has a special page that is (in frontend terms) completely unrelated to the rest of the site. in this case I might wish to remove existing requirements and include a different combined file because the common ground is to small to split it up into two files.)

@simonwelsh simonwelsh added the 3.1 label Apr 3, 2014
@tractorcow
Copy link
Contributor

Wow, this a bug still in 4.x too. =( Should be easy fix?

@dhensby
Copy link
Contributor

dhensby commented Jul 27, 2017

Bump

@flamerohr
Copy link
Contributor

flamerohr commented Aug 28, 2017

Pull requests made to address this:

@flamerohr flamerohr removed their assignment Aug 28, 2017
@tractorcow tractorcow self-assigned this Aug 28, 2017
@flamerohr flamerohr self-assigned this Aug 29, 2017
@tractorcow
Copy link
Contributor

Fixed. :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants