Opened 3 months ago
Last modified 8 weeks ago
#23831 new defect (bug)
Insert Into Post for Audio / Video doesn't always work
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.6 |
| Component: | Post Formats | Version: | trunk |
| Severity: | normal | Keywords: | has-patch commit |
| Cc: |
Description
As Otto pointed out, "Link To" can be set to "None" which was sending a broken shortcode to the editor. The HTML sent to the editor should be based on what is selected using "Link To" in the Media modal.
Attachments (8)
Change History (33)
wonderboymusic
— 3 months ago
comment:1
wonderboymusic
— 3 months ago
comment:3
wonderboymusic
— 3 months ago
Will in-westi-gate
comment:4
wonderboymusic
— 3 months ago
- Keywords commit added; needs-refresh removed
this is still necessary - the patch still applies cleanly and needs to be committed, but the ticket shouldn't be closed yet, need to decide what to do when someone selects "Link to Attachment Page" or whatever
comment:5
wonderboymusic
— 3 months ago
this is mainly for the content editor, not the format meta
comment:6
markjaquith
— 3 months ago
In 23870:
wonderboymusic
— 3 months ago
comment:7
follow-up:
↓ 8
wonderboymusic
— 3 months ago
attachment:23831.2.diff enforces dimensions for video, when present, in all cases. The post format meta for video is now a shortcode, so the dimensions don't have to be looked up on the fly. For audio and video, the meta can be an attachment id, url, HTML embed code, or a shortcode
Introduces attachment_url_to_postid() which will try to convert a URL containing a home_url() front into post ID by looking at the guid column for an attachment in the posts table
The issue Otto brought up, which is the original reason for this ticket, still exists. The question is: should the content change for Insert Into Post for audio or video when the user selects the custom, file, post or none URL option. As it stands, all insert the proper shortcode, there is no difference based on that selection
comment:8
in reply to:
↑ 7
;
follow-up:
↓ 25
azaozz
— 2 months ago
Replying to wonderboymusic:
Introduces attachment_url_to_postid() which will try to convert a URL containing a home_url() front into post ID by looking at the guid column for an attachment in the posts table
This will not work on many sites. The guid is _not_ the url to an attachment when the site or the uploads directory has been moved. To do something like this you will need to look at _wp_attached_file post meta, etc. Check out wp_get_attachment_url().
wonderboymusic
— 2 months ago
comment:9
wonderboymusic
— 2 months ago
Refreshed against latest trunk
comment:10
SergeyBiryukov
— 2 months ago
Wouldn't url_to_postid() work for attachments? From my testing, it does.
comment:11
wonderboymusic
— 2 months ago
last I checked, only checks attachment page, not the actual file
comment:12
wonderboymusic
— 2 months ago
I am going to redo that func as per Ozz
comment:13
SergeyBiryukov
— 2 months ago
Replying to wonderboymusic:
last I checked, only checks attachment page, not the actual file
Indeed, I only tested with attachment pages.
wonderboymusic
— 2 months ago
comment:14
markjaquith
— 2 months ago
In 23969:
wonderboymusic
— 2 months ago
comment:15
wonderboymusic
— 2 months ago
23831.5.diff fixes the 404 - dynamic rendering of file types that trigger Flash or Silverlight was the issue
comment:16
markjaquith
— 2 months ago
23831.5.diff doesn't fix the 404 for me. The 404 happens on the front end and the back end. This fixes neither for me.
comment:17
wonderboymusic
— 2 months ago
Can you confirm your cache is empty? I was able to reproduce the error repeatedly until I cleared Chrome browser cache
comment:18
markjaquith
— 2 months ago
My cache is completely empty. Multiple browsers. Still can reproduce the issue.
Did you upload the wrong patch or forget to add a file to the stage? Looking at .5.diff, I can't imagine why you'd think that would have any effect on the front of the site.
comment:20
wonderboymusic
— 2 months ago
It still works for me locally, not sure what is up - I pasted the URL on GitHub
wonderboymusic
— 2 months ago
wonderboymusic
— 2 months ago
comment:21
wonderboymusic
— 2 months ago
23831.6.diff + flashmediaelement.swf are latest for MEjs 2.11.3 - works for me... could use other testers. Need to select videos that trigger the Flash or Silverlight plugin so that we can confirm the .swf and .xap paths aren't 404ing
comment:22
markjaquith
— 2 months ago
In 23977:
comment:23
kovshenin
— 2 months ago
Missed a semicolon in [23870], see 23831.7.diff.
comment:24
SergeyBiryukov
— 2 months ago
In 23998:
comment:25
in reply to:
↑ 8
SergeyBiryukov
— 8 weeks ago
Replying to azaozz:
Replying to wonderboymusic:
Introduces attachment_url_to_postid() which will try to convert a URL containing a home_url() front into post ID by looking at the guid column for an attachment in the posts table
This will not work on many sites. The guid is _not_ the url to an attachment when the site or the uploads directory has been moved. To do something like this you will need to look at _wp_attached_file post meta, etc. Check out wp_get_attachment_url().
Sounds like a valid concern to me.
the attached patch makes the shortcode always work, but doesn't change when the Link To option changes. Working on that next.