- @imalabya opened merge request.
- 🇮🇳India imalabya Bangalore
The patch didn't address the wildcard entries in the pages. Adding a patch to fix that.
- 🇺🇸United States kentr
@imalabya: I'm getting an undefined variable warning after applying the patch.
Warning: Undefined variable $match in ajax_loader_page_attachments() (line 81 of modules/contrib/ajax_loader/ajax_loader.module).
I don't see current Drupal standards on undefined variables, but I think eliminating them is helpful if for no other reason than to help more critical errors stand out more.
Adding
$match = FALSE;
~ line 57 removes the error.@mvogel:
I am not sure that enabling ajax loader only on specific pages is a real use case
For me, the use case is keeping ajax loader from loading assets on pages that don't need them. With the current ajax loader functionality, I see the assets / libraries loading on all pages, regardless of whether they have any ajax functionality.
There may be a better way than this change to restrict the loader to only the pages that need it, though.
- 🇺🇸United States devkinetic
Coming back to this, I don't disagree that the current implementation of only loading on specific pages is incorrect, and it does make the configuration more needlessly complex. I do feel that the premise is still valid though. The way JS in Drupal works normally is that assets are only added to the page when they are specifically needed, and it should happen dynamically.
I think that a new implementation should be planned out, whatever that may actually be. Currently, the assets are added to pages that do not require it.