apologies if this is the wrong place to post this - I've tried to post it on ios.forums.wordpress.org but get ngix 404 errors when submitting…
Photos uploaded using the iOS Share Extension should be uploaded as Media items (they are), added to a blog post as content (they are), and the Media item should be associated with the blog post (this is not happening). In my testing, the photo is successfully uploaded as Media, but that Media item isn't associated/linked to the blog post (as seen in the "Uploaded To" field of the Media item).
When I try to use the Share Extension to share a photo from Photos (select a photo, click the box/arrow Share icon, then select WordPress), the post gets published but the uploaded image isn't associated with the post in the Media section. If I edit the post using the web interface, remove the image, and re-add it manually, it's properly associated with the Media item.
The basic post-photo-to-blog functionality works, but without the additional metadata to associate the uploaded image and Media item with the post, plugins like YD Recent Images http://www.yann.com/en/wp-plugins/yd-recent-images can't generate the list of recently published photos because they rely on Media associations to posts.
For example - my blog has a "Photos" page (using YD Recent Images), to list the most recent 100-or-so photos.
https://darcynorman.net/photos/
Photos published by the WordPress iOS app don't show up on that page, but do show up normally on the post category page:
https://darcynorman.net/type/image/
Running the latest WordPress for iOS 9.6.1, connecting to self-hosted WordPress site running 4.9.5
@bummytime can you please take a look at this one?
Thank you for this detailed issue @dlnorman! This is indeed a known issue with the iOS share and draft extensions and will be addressed in an upcoming release.
Possible approach:
In ShareExtensionSessionManager.swift, associate the media with new post in the urlSessionDidFinishEvents func.
Don't forget that this functionality essentially needs to be duplicated in AppExtensionsService.swift's combinePostWithMediaAndUpload func because of the non-deterministic way the NSURLSession completion callbacks are fired.
@ctarda I'm still seeing this issue, using the same reproduction steps as the original report yielding an uploaded attachment that does not have the corresponding post as its parent. Happens in version 11.4.1 of the app connected to a self-hosted site running 4.9.9.
Re-opening this issue so we can investigate.
@ChrisHardie @bummytime I have spent a significant amount of time trying to reproduce this issue and I haven't been able to see if fail. I have been testing with our latest and greatest in development and a self hosted blog, linked to with jetpack, and another self hosted blog without jetpack, both on 5.0.3
I have tried everything I can think of: very small and very large images, posts with short and long text content, simulating bad network conditions, and it seems to work as expected. So, there has to be something else, (maybe a plugin, maybe a user role, but there has to be something else that I am missing)
Just to refresh our memories, the extension first uploads the media items, then calls the remote API to create a post, and when the post is created, assigns the postID to each media item and updates them.
I have been testing with two browser windows open: one with my blog's post list (http://{mydomainname}.com/{myblogname}/wp-admin/edit.php) and another one with the media library (http://{mydomainname}.com/{myblogname}/wp-admin/upload.php)
When the media uploads start, I refresh the media library in my browser until I see the new media item(s). If I select the media item(s) before the post has been created (which might take some time) the media item remains as not linked to any post. Once the post is created, if I refresh the media library, I can see how the media items are now linked to the post.
I am running out of ideas to test and try to break this. Any suggestions would be more than welcome!
With no responses to @ctarda I'm feeling like this can be closed. Please speak up if you disagree.
This may have been fixed by #11740. Due to previous lack of response and my suspicions that this is fixed, I'm closing this issue. Please reopen if it happens again.
cc @designsimply
This is similar to #9118?