Skip to content

Compiler does not output "Core" dependencies (jQuery with a 'relative' path) #332

@christophherr

Description

@christophherr

https://community.getbeans.io/discussion/compiling-wordpress-scripts-breaking-uikit-elements/

This looks like a regression in 1.5 that potentially affects/breaks Beans websites when assets are flushed/recompiled.

I just checked. This didn't work in 1.4 either.

When the jQuery dependency is processed, combine_fragments() calls get_content() which calls get_internal_content().
get_internal_content() checks if the file_exists.
Because the path is just /wp-includes/js/jquery/jquery.js, it fails the test and beans_url_to_path() is called, which again returns /wp-includes/js/jquery/jquery.js .
And that fails the final file_exists check again.
jQuery is not added to the resulting file.

#328 attempts to fix this in beans_url_to_path().

@hellofromtonya
Is this a scenario that beans_url_to_path() should handle to begin with or should this be handled in get_deps_to_be_compiled(), e.g by prepending the site_url (or simply '.') to dep_src when necessary?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions