[BUG]: CHAR(64) isn't big enough for J4/J5 image strings #1109

Closed
opened 2024-04-22 02:52:42 +00:00 by stutteringp0et · 8 comments
Member

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]

### 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]
stutteringp0et added the
Bug
label 2024-04-22 02:52:42 +00:00
Owner

To increase the database size is an option... painful as that is.

To increase the database size is an option... painful as that is.
Member

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.

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.
Robot referenced this issue from a commit 2024-04-22 13:32:43 +00:00

Shouldn’t the field be changed to whatever joomla is using?

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 extra data behind the url had a function. If you use the html helpef it auto adds sizing to the image that is generated.
Owner

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 ;)

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](https://git.vdm.dev/joomla/Component-Builder/src/commit/ebbcf2bea50939479ec4e06d7c524879958c65df/admin/sql/updates/mysql/3.2.1-beta1.sql) ;)
Author
Member

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.

dern - it sounded like a good idea

> 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. dern - it sounded like a good idea
Robot referenced this issue from a commit 2024-04-24 19:31:38 +00:00
Robot referenced this issue from a commit 2024-04-24 19:38:37 +00:00
Owner

With the latest beta releases of both 4 and 5 this issue should be resolved.

With the latest beta releases of both [4](https://git.vdm.dev/joomla/pkg-component-builder/src/tag/v4.0.0-beta5) and [5](https://git.vdm.dev/joomla/pkg-component-builder/src/tag/v5.0.0-beta5) this issue should be resolved.
Member

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.

After testing the latest releases of JCB [v5.0.0-beta5](https://git.vdm.dev/joomla/Component-Builder/commit/59af18e13a1011137b2df8597d90de739363f5e5) and [v4.0.0-beta5](https://git.vdm.dev/joomla/Component-Builder/commit/9e78f8379ea1d22b86a748a800e3dd4fc8a67b75), I have confirmed that the issue has been successfully resolved. This issue can be closed.
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: joomla/Component-Builder#1109
No description provided.