Language Change ? ? Pending

User tests: Successful: Unsuccessful:

avatar chmst
chmst
18 Jan 2021

Pull Request for Issue #31026 .

Summary of Changes

Remove the width and height field for images, add an image class field instead like in other images in j4.

Testing Instructions

Make a module of type random image.
With the image class field, it is possible to add a own class and style it, no override is needed.

Actual result BEFORE applying this Pull Request

see #31026 .

Expected result AFTER applying this Pull Request

Random images can be styled as the user likes,

Documentation Changes Required

maybe

avatar chmst chmst - open - 18 Jan 2021
avatar chmst chmst - change - 18 Jan 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 18 Jan 2021
Category Language & Strings Modules Front End
avatar ChristineWk ChristineWk - test_item - 18 Jan 2021 - Tested successfully
avatar ChristineWk
ChristineWk - comment - 18 Jan 2021

I have tested this item successfully on 94aa375


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32075.

avatar gostn gostn - test_item - 19 Jan 2021 - Tested successfully
avatar gostn
gostn - comment - 19 Jan 2021

I have tested this item successfully on 94aa375


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32075.

avatar richard67
richard67 - comment - 19 Jan 2021

@SharkyKZ What's the reason for your thumb down?

avatar brianteeman brianteeman - test_item - 22 Jan 2021 - Tested unsuccessfully
avatar brianteeman
brianteeman - comment - 22 Jan 2021

I have tested this item ? unsuccessfully on 94aa375

This isnt quite correct. Not only are you adding an image class but you are also removing the width and height. Why?

Regarding the image folder isnt there a defined variable for the base images directory in com_media?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32075.

avatar chmst
chmst - comment - 23 Jan 2021

@brianteeman I removed width and height as we did for other images in j4.
Adding an individual class to the image allows users adding own css definitons also for width and height, using px, em, rem or whatever they want.

avatar chmst chmst - change - 25 Jan 2021
Labels Added: ? ?
avatar chmst chmst - change - 25 Jan 2021
The description was changed
avatar chmst chmst - edited - 25 Jan 2021
avatar chmst
chmst - comment - 25 Jan 2021

Revert form field folder.

avatar ChristineWk ChristineWk - test_item - 25 Jan 2021 - Tested successfully
avatar ChristineWk
ChristineWk - comment - 25 Jan 2021

I have tested this item successfully on 251e326


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32075.

avatar gostn gostn - test_item - 26 Jan 2021 - Tested successfully
avatar gostn
gostn - comment - 26 Jan 2021

I have tested this item successfully on 251e326


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32075.

avatar richard67 richard67 - alter_testresult - 26 Jan 2021 - ChristineWk: Tested successfully
avatar richard67 richard67 - alter_testresult - 26 Jan 2021 - gostn: Tested successfully
avatar richard67
richard67 - comment - 26 Jan 2021

Last change was only code style, so previous test results are still valid. I've restored them in the issue tracker.

avatar richard67 richard67 - test_item - 26 Jan 2021 - Tested successfully
avatar richard67
richard67 - comment - 26 Jan 2021

I have tested this item successfully on fbc6282

Works well, tested with bootstrap image classes.

Removal of width and height and usage of image classes is consistent with other places where we define images.

Custom image folder in Joomla root works well.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32075.

avatar richard67 richard67 - change - 26 Jan 2021
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 26 Jan 2021

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32075.

avatar chmst
chmst - comment - 26 Jan 2021

Thank you for testing.
As it is now, everyone can style the images as he/she wants.
But there is a gap for migrating from older versions, where maybe width and height for images is set and would be a b/c thing.

Re-Adding width and height as it was before could be done but:

  • width as a integer field and assuming it is "px" (default 100px) is old, it could be as well % or rem or em.
  • height as an integer field is wrong, it could as well be "auto"

Would be great to have some thoughts @richard67 @brianteeman?

avatar brianteeman
brianteeman - comment - 26 Jan 2021

Why not simply ADD your new field to the existing module?

avatar richard67
richard67 - comment - 26 Jan 2021

Hmm, the existing code (without this PR) seems to add width and height to the image in any case.

When having a new class field like the one added by this PR, we can use the class in addition to width and height, like e.g. some bootstrap 5 classes for round corners.

But we also might want to use some own class for specifying dimensions. For this use case I think it could be useful to have some way to switch off the width and the height field.

Unfortunately they are integer fields, so there is no option for "no value".

Maybe we could agree to use zero value for that purpose, and in this case not add the corresponding property (width or height) to the image.

avatar brianteeman
brianteeman - comment - 26 Jan 2021

Hmm, the existing code (without this PR) seems to add width and height to the image in any case.

That could be changed to only add if present

avatar richard67
richard67 - comment - 26 Jan 2021

Hmm, the existing code (without this PR) seems to add width and height to the image in any case.

That could be changed to only add if present

Yes, that was what I was thinking about. But what means "present" in case of an integer field? Greater than zero?

avatar richard67
richard67 - comment - 26 Jan 2021

Another thing is that the existing field hard-codes the unit to "px", no way to use "em", "rem", ...

Maybe we should have separate value and engineering unit fields for each width and height?

avatar richard67
richard67 - comment - 26 Jan 2021

Maybe it can be done in 2 steps:

  1. Change this PR so it doesn't remove the width and height fields but just adds the new image class field.
  2. Further enhancements in future PR(s).

What do you think?

avatar chmst
chmst - comment - 26 Jan 2021

@richard67 yes, will do that. With respecting #22065.

avatar laoneo
laoneo - comment - 28 Jan 2021

If you want to properly support lazy loaded images (and that's what we are aiming for in Joomla 4), a width and height of the image is needed. IMO this is wrong to remove the sizes of the image.

avatar chmst
chmst - comment - 28 Jan 2021

If you want to properly support lazy loaded images (and that's what we are aiming for in Joomla 4), a width and height of the image is needed. IMO this is wrong to remove the sizes of the image.

Thank you! Will re-add fields asap.

avatar alikon alikon - change - 28 Jan 2021
Status Ready to Commit Pending
avatar alikon
alikon - comment - 28 Jan 2021

set back to pending as requested


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32075.

avatar Razzo1987 Razzo1987 - test_item - 17 Feb 2021 - Not tested
avatar Razzo1987
Razzo1987 - comment - 17 Feb 2021

I have not tested this item.

We have tested it before the new updates and work correctly with nightly 17 feb


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32075.

avatar chmst chmst - change - 17 Feb 2021
Labels Added: ?
avatar chmst chmst - change - 15 Mar 2021
Title
[4.0] Mod_random_image add image class
[4.1] Mod_random_image add image class
avatar chmst chmst - edited - 15 Mar 2021
avatar Shubhamverma2796
Shubhamverma2796 - comment - 8 Jan 2022

I have tested this item successfully on ba960ff


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32075.

avatar Shubhamverma2796 Shubhamverma2796 - test_item - 8 Jan 2022 - Tested successfully
avatar pritam825
pritam825 - comment - 8 Jan 2022

I have tested this item successfully on ba960ff


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32075.

avatar pritam825 pritam825 - test_item - 8 Jan 2022 - Tested successfully
avatar richard67
richard67 - comment - 8 Jan 2022

@chmst As far as I can see it still needs to add back the width and height fields for lazy loading, right? If so, why has the "Updates Requested" label been removed?

avatar chmst chmst - change - 14 Jan 2022
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2022-01-14 23:48:52
Closed_By chmst
Labels Added: Language Change ? ?
Removed: ? ? ?
avatar chmst chmst - close - 14 Jan 2022

Add a Comment

Login with GitHub to post a comment