-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.3] Fix Media Field with Windows directory separator in value #39248
[4.3] Fix Media Field with Windows directory separator in value #39248
Conversation
I have tested this item ✅ successfully on 546b4c4 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39248. |
I've tested this and can confirm that it fixes the original issue 39203 which I raised. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39248. |
@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 ✅ successfully on 546b4c4 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. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39248. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39248. |
Thank you! |
Pull Request for Issue #39203.
Summary of Changes
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.
Testing Instructions
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 :
Actual result BEFORE applying this Pull Request
You see notice like below:
Notice: Undefined offset: 0 in ...\libraries\src\Form\Field\MediaField.php on line 294
Expected result AFTER applying this Pull Request
No notice anymore.