-
Notifications
You must be signed in to change notification settings - Fork 241
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
Fix EZP-23207: image alt text not modified if file is not set. #1040
Conversation
My tests indicate the PR resolves this issue, but also re-introduces https://jira.ez.no/browse/EZP-22615 bug. |
if ( $http->hasPostVariable( $base . "_data_imagealttext_" . $contentObjectAttribute->attribute( "id" ) ) ) | ||
{ | ||
$imageAltText = $http->postVariable( $base . "_data_imagealttext_" . $contentObjectAttribute->attribute( "id" ) ); | ||
$hasImageAltText = true; | ||
$content->setAttribute( 'alternative_text', $imageAltText ); | ||
$result = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure that it should return true if there is no file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modifying alternative text should make it so, I believe.
Actually, should the file always exist (if it's not being uploaded)?
The problem is that ALL custom actions are considered as 'store' actions by default, and 'delete_image' is no exception... Needs further investigation. |
Updated to allow image removal yet again. |
You mean 4fa0c1a? If so why don't we do that (as first commit to this branch) and try to minimize changes done here(as second commit to this branch). |
…image from an object" This reverts commit 4fa0c1a.
Done, hope this is OK. (not sure about messages either)... |
ok, but did you do a native git revert here? (preferable) |
Yes, I used git revert |
Confirmed that the bug is introduced by EZP-22615 and fixed by the PR. However, image removal doesn't work in my test. |
@joaoinacio same issue for you when testing last iteration of patch? |
Yes, i'm doing more tests now and unable to remove the file for some reason, even though the logic is pretty much the same... |
Just noticed that as I click "Remove image", the "Store draft" button appears in the top bar, and immediately disappears again. The page url doesn't change, but it looks like a quick redirect. |
PR Updated, my tests seem OK now. |
If you mean after 19f829c, I tested that and no change on my end, can't delete images. The error.log says: |
… an image from an object"
Final, tested, working, fix. promise. |
review ping @bdunogier @yannickroger |
My test 1: Click remove image, the image itself is gone but the "current image" line with filename and mimetype remains. Publish, and the image is gone. So there seems to be a minor remaining issue with the refreshing of the "current image" line. |
@glye: double-checked in different installations for 5.3 and master, and everything seems to be working OK. |
@joaoinacio I trust you then, my test env. may not be 100% correct. The Travis fail is afaik an ongoing issue and nothing to worry about. review ping @bdunogier @yannickroger |
Looks OK +1 |
Fix EZP-23207: image alt text not modified if file is not set.
JIRA: https://jira.ez.no/browse/EZP-23207
This fixes a regression in EZP-22615 , that causes an image attribute's alt text to not be updated if the file is not modified as well.