User tests: Successful: Unsuccessful:
Pull Request for Issue #39203.
Sometime, on a window system, value stored for a media form field has this format images\headers\banner.jpg
and it will throw warning and there will be notice like below when you edit the record contains that field:
Notice: Undefined offset: 0 in ...\libraries\src\Form\Field\MediaField.php on line 294
This PR just fixes that notice.
If you want to fully re-procedure the issue, you need to have Joomla setup on windows and follow instructions at #39203 (comment) to see the issue. However, there is a simple way to re-procedure it :
$this->value = 'images\headers\banner.jpg';
You see notice like below:
Notice: Undefined offset: 0 in ...\libraries\src\Form\Field\MediaField.php on line 294
No notice anymore.
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Title |
|
Title |
|
Labels |
Added:
PR-4.3-dev
|
I've tested this and can confirm that it fixes the original issue 39203 which I raised.
I've tested this and can confirm that it fixes the original issue 39203 which I raised.
@robbiejackson Please use the blue "Test this" button at the top left corner in the issue tracker, then select your test result and then submit, so your test is properly counted. Thanks in advance.
I have tested this item
Tested using images uploaded from a front-end form and which resulted in the images being given pathnames which were of the Windows format (with backslashes). This included tests for wben the Media Global Config "Path to Images Folder" was set to a Windows-format pathname images\photos, as well as a linux format pathname, and the images uploaded were saved to that folder.
These image files were then treated as media form fields in the admin backend, and the tests confirmed that the fields displayed and were editable ok, both before and after the associated records (with the image pathnames) were saved to the database.
Status | Pending | ⇒ | Ready to Commit |
RTC
Labels |
Added:
?
|
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-11-25 10:19:40 |
Closed_By | ⇒ | laoneo |
Thank you!
I have tested this item✅ successfully on 546b4c4
Looks good. Tested on Windows 11.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39248.