Forum Replies Created
-
AuthorPosts
-
ComSi
ParticipantThat might work, thanks for the tip.
ComSi
ParticipantThat would work most of the time. But when another plugin loads RWMB without any extensions, and we need the Group-extension, how will we be able to load that?
Wouldn't it be better to have RWMB and each extension to check for it before it loads itself?
ComSi
ParticipantSo best practise would be to not use an autoloader for Composer but manually load in the classes if they not exist?
ComSi
ParticipantAh yes, it is a plugin compatibility problem. In the other plugin MetaBox is also embedded in the plugin via Composer. I guess we will have to find away around that. Any pointers on how to best work with two plugins? It isn't really covered in the docs (Composer & Composer Extensions).
ComSi
ParticipantAin't that the truth. 😉
ComSi
Participant@content Pilot
You need to clear the composer cache and re-install (not update) the vendor plugins.
rm -rf vendor && composer clear-cache && composer installSee the docs here: https://docs.metabox.io/extensions/composer/#versions--updates
ComSi
ParticipantHi Long,
This fixes the issue. Great work, thanks a lot!
ComSi
ParticipantI think I have the same problem, I think I found out why. To me this looks like a bug.
When you have just
style=no-boxesandcolumns=1set, nothing changed and you still get the boxed layout.
When you add thetabskey, then theno-boxeslayout kicks in.$settings_pages[] = [ 'id' => 'vacancies', 'option_name' => 'vacancy', 'menu_title' => __('Vacancies', 'vac'), 'parent' => 'options-general.php', 'style' => 'no-boxes', 'columns' => 1, // remove this and the box layout appears 'tabs' => [ 'test' => "Test" ] ];This is undesirable because we just want to mimic a normal WP settings page, those don't have tabs and no white boxes.
Or am I missing something?
ComSi
ParticipantHi,
Okay, I can see the misunderstanding now!
The option is only used set when the post is created the very first time. After it has been saved once, thestdoption will be ignored.
I thought it would only be ignore when that specific option has been saved once.I was creating a page and adding meta boxes one after another, while saving the post in between. Then when I added the
select_advancedwith thestdoption set, while the post had been saved before. In this case it is ignored.That took me quite a while to understand correctly.
ComSi
ParticipantI was afraid so.
We'll use jQuery too in this case, thanks for checking.
ComSi
ParticipantThanks Anh Tran, that is basically what I was looking for!
I ended up with the following code (for anyone that would like a working example):
(function($) { setTimeout(() => { // Set this to the input field that needs to be updated with the new coordinates var $coordsInput = $("#debug_geometry"); // Get the map controller var mapController = $(".rwmb-map-field").data("mapController"); // Update the coordinates field with the new position the marker has been dragged to google.maps.event.addListener(mapController.marker, "dragend", function(event) { mapController.marker.setPosition(event.latLng); mapController.updateCoordinate(event.latLng); // update the input field with the marker location $coordsInput.val(event.latLng.lat() + "," + event.latLng.lng()); }); // we need to wait 200ms for the map to be loaded and available }, 200); })(jQuery);Question though. I would rather have liked being able to use vanilla javascript instead of jQuery, trying to move away from jQuery wherever possible; But somehow
document.querySelector(".rwmb-map-field").dataset.mapControllerisundefined.
Any idea why?ComSi
ParticipantHi Anh,
Thanks for the update. Now it works just fine.
Cheers!
Erik-JanComSi
ParticipantThanks, the clear cache fixed it. We tried to update this but it stays on version 1.2.5.
Now it's on 1.2.6 it works like a charm. Thanks!
ComSi
ParticipantDid the fix actually made it to production @Anh Tran?
When I press [enter] in this field, the full page will be submitted and reloads before the other (bind-)fields are populated.

I run Geolocation version 1.2.5, I believe that is the latest available, composer does not update it.
ComSi
ParticipantHi Anh,
We double-tripple checked and have it all sorted out now, the bug happened because of an older plugin that never updated from 4.18 version to the ^5 branch. Since that plugin was called before our other plugin it was causing problems. After updating every plugin to ^5 via composer, it was all sorted.
Thanks again! ?
-
AuthorPosts