Opened 8 years ago
Closed 8 years ago
#36861 closed defect (bug) (fixed)
The Insert into post button in the Edit Image window doesn't work.
Reported by: | tai | Owned by: | adamsilverstein |
---|---|---|---|
Milestone: | 4.5.3 | Priority: | normal |
Severity: | normal | Version: | 4.5 |
Component: | Media | Keywords: | has-patch commit fixed-major |
Focuses: | javascript | Cc: |
Description
The Insert into post button in the Edit Image window doesn't work.
Steps to reproduce:
- Open "Add New Post".
- Open "Add Media".
- Choose an image and click the "Edit Image" text link (screenshot 1).
- Click the "Insert into post" button (screenshot 2).
- Back to the post edit window, but the image link is not inserted.
screenshot 1: https://www.evernote.com/l/ACCqjc1fZTNJY5ephI7a5mf7E1vcVk9OgeE
screenshot 2: https://www.evernote.com/l/ACB0-GSdgcBOfKUIy36WkwCS3uhvhU3Ktw8
I've tried with WordPress 4.5.2, Twenty Sixteen, and no plugin activated.
Also tested with WordPress 4.6-alpha-37444 and the button doesn't work.
The button "Insert into post" was "Back" until WordPress 4.4.3.
Attachments (3)
Change History (28)
#1
@
8 years ago
- Component changed from General to Media
- Focuses javascript added
- Keywords needs-patch added
- Milestone changed from Awaiting Review to 4.5.3
- Version changed from 4.5.2 to 4.5
This ticket was mentioned in Slack in #core by adamsilverstein. View the logs.
8 years ago
#3
@
8 years ago
As I suspected, this broke when we upgraded Backbone/Underscore in [36546]; I am working on tracking down the fix.
#4
@
8 years ago
- Owner set to adamsilverstein
- Status changed from new to assigned
Debugging this media code is difficult because of the complexity with which events are both registered and triggered.
Since upgrading Backbone, the handler that updates the 'toolbar' at the bottom of the edit image view is never triggered, so the 'Insert into Post' button still shows (and doesn't work)... The toolbar is supposed to show the 'Back' button,
36861.diff fixes the issue by changing the way the toolbar render is triggered when switching into the image edit mode.
Previously activate/deactivate were being called when switching to this view and these attached and detached (respectively) handlers intended to be triggered by the switch to render the correct toolbar - the footer area where the back button shows. This is an initial patch and can be further cleaned by/simplified removing activate/deactivate entirely and calling the render method directly.
#6
@
8 years ago
Patch works well so far, but could benefit from the suggested cleanup.
Also note that line 36 this.toolbar;
doesn't work as it should be this.toolbar();
This ticket was mentioned in Slack in #core-images by joemcgill. View the logs.
8 years ago
#8
@
8 years ago
In 36861.2.diff:
- Replace
listenTo
withon
, similar to #36900 - Replace
stopListening
withoff
- Fixes an issue where the handler was never called
This patch maintains the activate/deactivate pattern used throughout the media library, switching the listen method: listenTo
doesn't work correctly in this context since [36546].
This ticket was mentioned in Slack in #core by adamsilverstein. View the logs.
8 years ago
#11
@
8 years ago
Just tested the patch on 4.5.2 and it doesn't work for me
OS: Windows 10
Browser: Chrome 50.0.2661.102 , Safari 5.1.7 , IE-11 , Firefox 46.0.1
WP 4.5.2
Server Environment : VVV
#14
follow-up:
↓ 19
@
8 years ago
@monikarao and @almendron thanks for testing and leaving feedback.
@monikarao – since you're using VVV, are you testing on http://src.wordpress-develop.dev or http://build.wordpress-develop.dev? If the latter, you may need to run grunt build
first before the changes take affect.
@almendron – I'm not entirely clear on what error you're experiencing. If you're saying that once you applied the patch that the button in step 4 has been replaced with a "Back" button, then that's the expected behavior of this fix. If something else is happening, could you explain in more detail, or leave screenshots? Listing the OS/Browser version you are testing on is helpful as well.
#15
@
8 years ago
The patch does not seem to work correctly on wordpress-trunk using
Browser: Chrome 50.0.2661.102 (64-bit) , 46.0 Mozilla Firefox for Ubuntu
WP: 4.5.2
OS: Ubuntu
Server Environment : VVV
#16
@
8 years ago
@lukecavanagh are you still seeing the 'Insert into Post' button in the edit details view? You should see a 'Back' button.
This ticket was mentioned in Slack in #core-images by adamsilverstein. View the logs.
8 years ago
#18
@
8 years ago
36861.3.diff patch the source file instead of the built file
#19
in reply to:
↑ 14
@
8 years ago
Replying to joemcgill:
@almendron – I'm not entirely clear on what error you're experiencing. If you're saying that once you applied the patch that the button in step 4 has been replaced with a "Back" button, then that's the expected behavior of this fix. If something else is happening, could you explain in more detail, or leave screenshots? Listing the OS/Browser version you are testing on is helpful as well.
Button "back" (version 4.4) in step 4 has been replaced with a "Insert into post" (version 4.5) button. The error is on the change button. Version 4.4 was "Back" and now "Insert into post".
#20
@
8 years ago
@joemcgill
Yes I am testing on http://src.wordpress-develop.dev/
This ticket was mentioned in Slack in #core-images by joemcgill. View the logs.
8 years ago
#22
@
8 years ago
- Keywords commit added; needs-testing removed
36861.3.diff Looks good, but a note for other testers, you have to run grunt precommit
so the media-views.js
file gets rebuilt for this to take affect.
Just tested it on trunk and I can confirm the behaviour.
Would be great if we could get this into 4.5.3.