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

Conflict with Site Kit by Google (theme option) #786

Closed
SYip opened this issue Nov 16, 2019 · 2 comments
Closed

Conflict with Site Kit by Google (theme option) #786

SYip opened this issue Nov 16, 2019 · 2 comments

Comments

@SYip
Copy link

SYip commented Nov 16, 2019

Version

  • Carbon Fields: 3.1.7
  • WordPress: WordPress 5.3
  • PHP: 7.1

Expected Behavior

Theme option fields should be shown in theme option page.
Should not display errors in console.

Actual Behavior

Theme option fields are not displayed.
Error in console:

TypeError: u is undefined core.min.js:10:19659
TypeError: a is undefined metaboxes.min.js:1:6563
TypeError: d is undefined blocks.min.js:11:5870
TypeError: cf.core is undefined admin.php:1819:10

Steps to Reproduce the Problem

  1. Require carbon fields with composer in theme and set theme option
  2. Install site kit by google
  3. Go to theme option page

Comments

Please add any other comments here

@drzraf
Copy link

drzraf commented Jan 1, 2020

I'm getting TypeError: cf.core is undefined too, but without "Site Kit by Google" being installed.
cf is defined. cf.core is not.

One step deeper: most CBF assets hits 404 (at least on Bedrock), this is because \Carbon_Fields\URL is empty which is wrong what comes down to Carbon_Fields::directory_to_url( \Carbon_Fields\DIR ) )
(See also #457)

I really think there is too much magic here and should be simplified to match WordPress standard (and simplicity). All this assets' loading is specific to WordPress as such, it should be part of the WordPress plugin which can use the plugins_url* function.

I also think that when such a bug occurs a much informative error must be thrown. Eg: console.error("Can't load CBF");

@jorostoyanov
Copy link
Contributor

Cannot reproduce. Closing

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

No branches or pull requests

3 participants