[BUG]: CHAR(64) isn't big enough for J4/J5 image strings #1109
Labels
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#1109
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What Happened?
Joomla (recent versions) use a descriptive string along with the image path when you choose an image for a media element.
images/icons/material-design/300x300/ab-testing.png
becomes
images/icons/material-design/300x300/ab-testing.png#joomlaImage://local-images/icons/material-design/300x300/ab-testing.png?width=300&height=300
way too much text for a wee CHAR(64)
Steps to reproduce the Bug
Pick an image - try to save - component, admin view - it makes no difference.
Which Joomla version are you compiling in?
5.1.0
Which PHP version are you compiling in?
8.1
Which Joomla versions are you targeting?
5
Which PHP version are you targeting?
8.1
Which Web server is JCB running on?
nginx
Which Relational Database is JCB running on?
MariaDB 10.6
Which OS is JCB running on?
Ubuntu
Which JCB version are you using?
5b3
Where in JCB did this issue occur?
Other
On which browsers did you encounter the issue?
No response
Additional Comments
An easy fix, I believe, would be to add an onchange event to the media fields used in component creation.
this should do the trick:
this.value=this.value.split('#')[0]
To increase the database size is an option... painful as that is.
We have tested
this.value=this.value.split('#')[0]
in the onchange event of the media field and it still does not remove that extra descriptive string. So we might have to look at a server side fix.Shouldn’t the field be changed to whatever joomla is using?
The extra data behind the url had a function. If you use the html helpef it auto adds sizing to the image that is generated.
The change is not in all media fields JCB builds, but just for those media field used in JCB itself.
So yes each developer needs to deal with this for them selfs, but in jCB we will increase the table->column size and strip the extra data in the compiler on compilation of you component. We are not finished with the fix, but we have update the J3 table already ;)
dern - it sounded like a good idea
With the latest beta releases of both 4 and 5 this issue should be resolved.
After testing the latest releases of JCB v5.0.0-beta5 and v4.0.0-beta5, I have confirmed that the issue has been successfully resolved. This issue can be closed.