Comments (6)
Hi @djvdorp
Thanks for the bug report.
I'm not able to replicate this from my end, are you able to setup a fresh WP install without an other plugins and see if the issue persists?
from acf.
Sorry for the delayed reply. I haven't been able to reproduce the issue somewhere else yet, so it could potentially be related to another plugin or some setting that is off. I want to investigate this further soon!
from acf.
We found out that it is likely related to a plugin we're using, vBLink.
Please correct me if we're wrong, but it looks like this could be what is happening:
- ACF uses a global instance of itself, which somehow gets broken when vBLink is enabled
- ACF initializes itself in 2 hooks: first when plugins are loaded and then in
init
- it looks like vBLink makes ACF lose the global instance that ACF uses for itself
- what happens then is that only
init
is run and notinitialize
which causes some fields to not be there - that results in above error
We were able to find a (horrible) work-around for this, which is rather dirty but works:
[...]
// BEGIN VBLINK CODE
// making a backup so we can reassign values to their originals after it is loaded.
$requestSuperglobals = array($_GET, $_POST, $_REQUEST);
// END VBLINK CODE
// WORKAROUND: Ugly fix for not breaking page save due error in ACF
$saveAcf = $GLOBALS['acf'];
[...]
// BEGIN VBLINK CODE
list($_GET, $_POST, $_REQUEST) = $requestSuperglobals; <-- vBLink code
// END VBLINK CODE
// WORKAROUND: Restore ACF
$GLOBALS['acf'] = $saveAcf;
[...]
Since vBLink is not open source software, I can most likely not paste (all of the) the exact code, but I hope the above description makes sense to you to give you an idea what happens and what goes wrong here.
from acf.
Hi @djvdorp
Thanks for the reply and info.
ACF does use a global variable called $acf
, and this is initialized at the end of the main acf.php file via the function acf();
I'm not sure why the vBLink plugin would be causing such an issue, but this will definitely be something the developers should be aware of - can you please contact them and let them know?
Thanks
Elliot
from acf.
I would love to hit up the vBlink developers and inform them about this, but I am having a very hard time reaching them currently. I mostly wanted to share the workaround here for others right now.
I am closing this issue since I don't think there is much that you (on behalf of ACF) can do about this?
from acf.
After updating to latest ACF, faced same issue and thanks to @djvdorp for the tricky solution :)
from acf.
Related Issues (20)
- potential infinite loop in acf_get_field_ancestors()
- Block fields now show in the right hand side panel HOT 1
- True/False field fold together and can't be changed/updated HOT 3
- When returning false in acf/load_field or acf/prepare_field multiple warnings occur HOT 1
- ACF post preview and revisions completely broken HOT 8
- WYSIWYG 'visual' tab in sidebar breaks when switching sidebar tabs HOT 1
- WYSIWYG Editor Field: Image element with width and height attributes triggers unsafe HTML error message HOT 4
- filter wysiwyg_tinymce_settings breaking HOT 1
- Front-end form submits itself when closing the wordpress link-edit dialogue
- Nested cloned repeater only works for 1 level
- Gallery - edit image breaks field in block sidebar HOT 1
- ACF 6.3.0 update breaks "No fields assigned" filter with empty string HOT 3
- Can't add ACF licence key HOT 1
- update_field() not working as expected in this scenario HOT 3
- Installing through composer installs incorrect version HOT 5
- Uncaught TypeError: Cannot access offset of type string on string - flexible content HOT 4
- Fix jQuery deprecations HOT 1
- User field stopped showing in GraphQL query
- Group: image subfield nĀ°10 not working HOT 1
- PLEASE ADD A DISCLAIMER THAT SHORTCODES HAVE TO BE ENABLED NOW HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from acf.