? PBF ? ? Pending

User tests: Successful: Unsuccessful:

avatar brianteeman
brianteeman
6 Feb 2022

PR for #28852

The field was readonly for the reasons states by @dgrammatiko and I respect those views. But the request for the ability to paste an image url directly into the field by @coolcat-creations and others also makes sense.

As you can see its a super simple PR to achieve this. All the features of the media field are maintained and you can paste an image url directly. However when pasting a url you do not get the data attributes and lazy loading. I believe this to be an acceptable solution.

To test try to use the full article image or a custom media field and make sure you can still select an image and that you can now paste an image url

avatar brianteeman brianteeman - open - 6 Feb 2022
avatar brianteeman brianteeman - change - 6 Feb 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 6 Feb 2022
Category Layout
avatar coolcat-creations
coolcat-creations - comment - 6 Feb 2022

Hi @brianteeman thank you so much for creating the PR!

I thought the right solution would be to "validate the URL, get the image adapter, get the image dimensions" I see it coming that people complain that lazy load does not work.

So how can we make a good solution to 1) make the paths "pasteable" 2) have it working like intended by media manager team ?

Or would this be the first step, and maybe in 4.2 we can create a pseudocron which checks the image paths and adds this markup ?

avatar brianteeman
brianteeman - comment - 6 Feb 2022

I thought the right solution would be to "validate the URL, get the image adapter, get the image dimensions" I see it coming that people complain that lazy load does not work.

That's kind of what Dimitiris was telling you. If you want to paste the image then you cant have the other parts when you do

avatar coolcat-creations
coolcat-creations - comment - 6 Feb 2022

Yes, maybe I misunderstood him, I thought it was possible to do these checks for pasted paths but that he does not want to do it so he suggested a bad solution over the right solution. Did I misunderstood?

avatar dgrammatiko
dgrammatiko - comment - 6 Feb 2022

Fwiw the code for getting the size of the image already exists since #34177 so what is missing is a way to:

  • validate that what the user inserted is a valid url
  • Extract the media adapter if there is one

just Because it’s easy to remove an attribute it doesn’t mean that the result will be automatically acceptable. For me it’s not, the media field goes from a field that always produces valid urls to accepting any kind of strings…

avatar coolcat-creations
coolcat-creations - comment - 6 Feb 2022

Why isn't it possible to let the user put in the path and have a button which says "validate and save" or something?

avatar dgrammatiko
dgrammatiko - comment - 6 Feb 2022

Why isn't it possible to let the user put in the path and have a button which says "validate and save" or something?

That's not how form fields validation works in HTML. You have an event onInput that you can listen for inserted text and act upon it, there's no need for button or any other fancy UI...

avatar coolcat-creations
coolcat-creations - comment - 6 Feb 2022

So what is the right approach ? Where do we need to change what line?

avatar Razzo1987
Razzo1987 - comment - 7 Feb 2022

@brianteeman the preview dosn't work with image generated like https://via.placeholder.com/350x150

avatar Razzo1987
Razzo1987 - comment - 7 Feb 2022

Hi @dgrammatiko ,
I perfectly understand your safety point.
In the PR #31398 (which is not very different from @brianteeman 's) we had already discussed that it was necessary to reintroduce the functionality of being able to put custom URLs after their validation, but that at the moment NO ONE was working on it.

Today, the situation does not seem to have changed. Here (#28852 (comment)) you were also talking about integration with third-party sources. Another beautiful idea that I don't see it in the roeadmap for Joomla! 4.1 or 4.2.

Personally I think that for now the best way is to allow users to enter the custom URL as they did in Joomla 3, when we have a media manager who does the necessary checks and inserts images from Dropbox, AWS, S3, custom, etc we can again put back the read-only attribute.

avatar dgrammatiko
dgrammatiko - comment - 7 Feb 2022

I already stated what needs to be done here #36945 (comment) but then again I'm not a gatekeeper or some kind of authority here, so if allowing any string in this field value is acceptable then this PR is fine

avatar coolcat-creations
coolcat-creations - comment - 7 Feb 2022

Yes thanks but for me you could have write it in Japanese and i would not know what to do now :-) Maybe someone knows. I hope.

avatar RickR2H
RickR2H - comment - 22 Apr 2022

I have tested this item successfully on 233ad78

Patch works! Maybe it is a good idea to check if the image link is valid. Can be added in a new PR though.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36945.
avatar RickR2H RickR2H - test_item - 22 Apr 2022 - Tested successfully
avatar kiki-G
kiki-G - comment - 22 Apr 2022

I have tested this item ? unsuccessfully on 233ad78


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

avatar kiki-G kiki-G - test_item - 22 Apr 2022 - Tested unsuccessfully
avatar kiki-G
kiki-G - comment - 22 Apr 2022

I have tested this item successfully on 233ad78


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

avatar kiki-G kiki-G - test_item - 22 Apr 2022 - Tested successfully
avatar kiki-G
kiki-G - comment - 22 Apr 2022

I have tested this item ? unsuccessfully on 233ad78


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

avatar kiki-G kiki-G - test_item - 22 Apr 2022 - Tested unsuccessfully
avatar kiki-G
kiki-G - comment - 22 Apr 2022

I have tested this item successfully on 233ad78


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

avatar kiki-G
kiki-G - comment - 22 Apr 2022

I have tested this item successfully on 233ad78


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

avatar kiki-G kiki-G - test_item - 22 Apr 2022 - Tested successfully
avatar kiki-G kiki-G - test_item - 22 Apr 2022 - Tested successfully
avatar kiki-G
kiki-G - comment - 22 Apr 2022

I have tested this item successfully on 233ad78


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

avatar kiki-G kiki-G - test_item - 22 Apr 2022 - Tested successfully
avatar RickR2H RickR2H - change - 22 Apr 2022
Status Pending Ready to Commit
avatar RickR2H
RickR2H - comment - 22 Apr 2022

RTC


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

avatar dgrammatiko
dgrammatiko - comment - 22 Apr 2022

@RickR2H @brianteeman I object here. What this PR is doing is WRONG! ignoring that there's no validation and you can end up with FOOBAR values and 404 in your pages and the fact that this essentially bypasses the lazy loading feature there's something even more hurtful: the images will NOT have width and height attributes meaning that these images will contribute negatively in the Layout shifting metrics and thus hurting SEO!. Just let the people that want this functionality to create a layout override and themselves remove the readonly attribute OR find someone to write the few lines of JS needed so this could not have any MAJOR impact in performance and SEO.

Web Archive 2022 is in the way and afaik Joomla is not helping itself if keeps the last position in the ranking.

My 2c and unsubscribing

avatar coolcat-creations
coolcat-creations - comment - 22 Apr 2022

It would be really good to have the possibility to paste the path AND have width height - User Experience for selecting images is zero right now.

avatar richard67
richard67 - comment - 22 Apr 2022

Setting the RLDQ (release leads decision queue) label to get a decision.

avatar dgrammatiko
dgrammatiko - comment - 22 Apr 2022

User Experience for selecting images is zero right now.

You're not improving things by just making them worst, do you? I, keep repeating that this COULD be done reasonably with some JS but not just removing the readonly attribute simply because the results are not the same. Either fix it properly or keep the bad UX (according to you) which at least was done to improve SEO and perf...

avatar roland-d
roland-d - comment - 22 Apr 2022

As for "security" anybody with some wit can remove the readonly attribute using DevTools from their browser. Validation should always happen server side.

avatar coolcat-creations
coolcat-creations - comment - 22 Apr 2022

User Experience for selecting images is zero right now.

You're not improving things by just making them worst, do you? I, keep repeating that this COULD be done reasonably with some JS but not just removing the readonly attribute simply because the results are not the same. Either fix it properly or keep the bad UX (according to you) which at least was done to improve SEO and perf...

If it's so easy to improve it why won't you help? I can't because I don't know how.

avatar brianteeman
brianteeman - comment - 22 Apr 2022

If it's so easy to improve it why won't you help? I can't because I don't know how.

i tried

avatar coolcat-creations
coolcat-creations - comment - 23 Apr 2022

@dgrammatiko how much would it cost to fix it in a proper way?

avatar dgrammatiko
dgrammatiko - comment - 25 Apr 2022

Please close this and test #37654

avatar brianteeman
brianteeman - comment - 25 Apr 2022

Happy to

avatar brianteeman brianteeman - close - 25 Apr 2022
avatar brianteeman brianteeman - change - 25 Apr 2022
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2022-04-25 16:14:03
Closed_By brianteeman
Labels Added: ? PBF ? ?

Add a Comment

Login with GitHub to post a comment