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 upload button is not rendering #5860

Closed
jvisick opened this issue Mar 28, 2018 · 18 comments
Closed

Media upload button is not rendering #5860

jvisick opened this issue Mar 28, 2018 · 18 comments
Assignees
Labels
[Status] Needs More Info Follow-up required in order to be actionable. [Type] Plugin Interoperability Incompatibilities between a specific plugin and the block editor. Close with workaround notes.

Comments

@jvisick
Copy link
Contributor

jvisick commented Mar 28, 2018

Issue Overview

Working locally off of current master #f4c40f6 it looks like the MediaUpload component is not rendering anymore? I don't see it on the image block or the cover image block, as well as in the inspector for featured images.

Steps to Reproduce (for bugs)

  1. Open new page
  2. Add an image block
  3. Only option to upload new image is given

Screenshots / Video

screen shot 2018-03-28 at 2 23 55 pm

screen shot 2018-03-28 at 2 33 49 pm

@youknowriad
Copy link
Contributor

I can't reproduce this myself. It seems to work as expected for me.

@danielbachhuber
Copy link
Member

@jvisick What debugging have you done? Can you see if there are any JavaScript errors in your console?

@danielbachhuber danielbachhuber added the [Status] Needs More Info Follow-up required in order to be actionable. label Mar 28, 2018
@jvisick
Copy link
Contributor Author

jvisick commented Mar 28, 2018

@danielbachhuber No console errors. I have tried to isolate what commit it still works on. @youknowriad if you can't recreate it let me try and get some more info...

@jvisick
Copy link
Contributor Author

jvisick commented Mar 28, 2018

@danielbachhuber Okay, it appears to be a plugin conflict with ACF Pro (v5.6.9). I'll see if I can isolate it further.

@youknowriad
Copy link
Contributor

pinging @gziolo as this is probably related to the work we did on adding extensibility to the MediaUpload component #5211

@jvisick
Copy link
Contributor Author

jvisick commented Mar 28, 2018

@youknowriad @gziolo yes the merge of #5211 seems to be where the conflict was introduced.

@gziolo gziolo self-assigned this Mar 29, 2018
@gziolo
Copy link
Member

gziolo commented Mar 29, 2018

I'll try to reproduce myself with AFC Pro.

@gziolo
Copy link
Member

gziolo commented Mar 29, 2018

I couldn't reproduce with the free version of AFC:

screen shot 2018-03-29 at 12 44 36

Does it need to be a pro version? Do you have any specific fields configured which might cause some conflicts?

@shoetten
Copy link

shoetten commented Mar 29, 2018

I experience the same issue. It's not necessarily bound to the pro version, just to version 5 i think.
To reproduce, you can install ACF v5 either through composer or using the instructions described here:
https://www.advancedcustomfields.com/resources/upgrade-guide-version-5/

@mejta
Copy link

mejta commented Mar 29, 2018

Same for me ... using ACF Pro 5.6.9. When I disable the plugin it works, if I enable plugin, MediaUpload is not shown.

@jvisick
Copy link
Contributor Author

jvisick commented Mar 29, 2018

@gziolo I tested with a clean install of wp and just activating ACF Pro (v5.6.9) without any config causes the problem. I have not tried the free or earlier versions of ACF.

@shoetten
Copy link

shoetten commented Mar 29, 2018

Yeah, same here with a clean install of wp and only Gutenberg v2.5.0 and ACF v5.6 installed.
React incorrectly renders an <Unkown> component, instead of the actual button, when used together with ACF => v5.
react-dom-gutenberg-acf-incorrect

@gziolo gziolo added the [Type] Plugin Interoperability Incompatibilities between a specific plugin and the block editor. Close with workaround notes. label Mar 30, 2018
@gziolo
Copy link
Member

gziolo commented Mar 30, 2018

I was able to reproduce by installing ACF Pro (v5.6.9). I also found that other hooks don't work as expected. Copy Content button is missing in More Menu:

screen shot 2018-03-30 at 12 18 09

This issue is caused by the ACF implementation in assets/js/acf-input.js file, lines 8-250:

var EventManager = function() {
    ...
};

window.wp = window.wp || {};
window.wp.hooks = new EventManager();

Putting this into words, ACF reimplements wp.hooks instead of using the already present module registered under wp-hooks name. My understanding is that it removes some of the registered previously filters causing the issue.

There is nothing to do about it on the Gutenberg side, so closing this one.

@gziolo gziolo closed this as completed Mar 30, 2018
@gziolo
Copy link
Member

gziolo commented Mar 30, 2018

Thanks for your help with debugging this one. Any hints what is the best way to reach out to ACF team and help them fix this issue?

@gziolo
Copy link
Member

gziolo commented Mar 30, 2018

Okey, I opened an issue in ACF repository ☝️

@gziolo
Copy link
Member

gziolo commented Apr 3, 2018

This has been fixed in ACF PRO 5.6.10. When you have a chance, can you please update and test it out? If the problem persists, please let me know and I'll continue to investigate.

@jvisick, @mejta, @shoetten - can you confirm? :)

@mejta
Copy link

mejta commented Apr 3, 2018

@gziolo I can confirm that issue with MediaUpload is fixed with ACF PRO 5.6.10. When activated it works as expected. But they introduced new bug with wp.hooks :), but that is not affecting Gutenberg.

@gziolo
Copy link
Member

gziolo commented Apr 3, 2018

I bet they need to updated the names of their hooks to follow whatever wp.hooks expects. It’s definitely fixable. Thanks for your help 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Needs More Info Follow-up required in order to be actionable. [Type] Plugin Interoperability Incompatibilities between a specific plugin and the block editor. Close with workaround notes.
Projects
None yet
Development

No branches or pull requests

6 participants