Skip to content
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

Media Library URL’s change after plugin update #139

Merged
merged 9 commits into from
Jan 14, 2019

Conversation

NeilWJames
Copy link
Collaborator

I have tried without success to replicate the problem although I have implemented the Media library in a different URL and directory combination than standard.

The Featured Image process loads the image using the same mechanism as used for the document, but their interfaces are not both exposed to the program.

Its implementation was therefore to set a cookie that would differentiate between them.

I have to surmise that Troy's use is that the document library is the standard one and the issue is that information is some assigning the Media Items as being in the document directory.

As far as I could see, the use of the cookie is always after I have established that the post is for a Document so it really does not matter the value outside our scope.

This set of fixes is essentially defensive in that it:
a) Makes the default value in the absence of the cookie to be the image indicator (true) instead of document (false)
b) Sets the cookie to false only when the user clicks on the Upload Document button and to true only when the user clicks on the featured image area (other plugins can add buttons)
c) Deletes/Expires the cookie when the user clicks the Submit/Publish button; or when they quit via the Admin Menu or Bar. So that in normal exit cases, the cookie is no longer present.

With no detailed use case, I cannot guarantee that this will have addressed Troy's problem but it certainly will have reduced the possible issue.

@benbalter benbalter merged commit bdc1f30 into wp-document-revisions:master Jan 14, 2019
@benbalter
Copy link
Collaborator

Makes sense. Thanks for taking the time to track this down. I can work on getting this out along with #135. ✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants