-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
4.0 HTMLHelper - lazyloading #30615
Comments
can you post the complete error message please? |
My guess it's referring to |
Warning: Illegal string offset 'loading' in /mnt/web101/....../htdocs/ligatest/libraries/src/HTML/HTMLHelper.php on line 693 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30615. |
Any reason why? I'm really curious to know why Joomla shouldn't support something that magically improves perforrmance |
Joomla! Version 4.0.0-beta4-dev This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30615. |
Supporting it and forcing it by default are different things. |
You do realize that all browsers support it and it’s a platform feature, right? So yeah you re right why force it when you can be the the worst (in terms of performance) cms out there... PS. Just to be clear here I'm talking about loading=lazy for the content images (eg editor images and intro/fulltext), about HTMLHelper::image I guess since there is an option to pass any attribute the default forcing of the attribute is probably wrong, so in this case I will agree on reverting the forced attribute there |
Dump HTMLHelper Line 691 All requested images exist at the requested place. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30615. |
Sorry, I somehow did not see this issue here, when I opened My approach for solving this would probably be to change the methods parameters from |
Some more tinkering would be needed because |
Would it make sense to deprecate string support in the future? |
I changed it to "$attribs=array()", but no improvement. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30615. |
Together with the change of the methods parameters, this should do the trick (might be optimized code-wise):
|
As per the discussion about "forcing" this, you would have to invoke yet another configuration parameter to give the site owner the possibility to decide. I am not sure the additional complexity (new config field and language strings. Probably "active" information about this new feature to all Joomla webmasters - otherwise this might be overlooked easily) is worth the trouble. I had a similar discussion three years ago (see #17827 ) where it was decided to NOT INVOKE additional configuration settings. |
That would be the way to go in my opinion given that the options array allow us to extend the code without breaking anything. For now I'm closing this issue here as this is also fixed with #30748 by adding an is_array check for now :) |
New PR is #30790. Please test. |
Steps to reproduce the issue
on call an error on line 693 is the result.
Looks like "lazy" dosn't exist.
MfG HaJuSi
Expected result
Actual result
System information (as much as possible)
Additional comments
The text was updated successfully, but these errors were encountered: