Comments (13)
Ah !
Which version of the Gutenberg plugin do you use ?
I'm only checking if you have the gut plugin enabled if WP version < 5 but I don't check if it's the latest release
(as I said on wp.org, it's difficult to be ready for every version because of a lot of changes)
Thanks for the donation!
from agb.plugin.
Gutenberg 4.6.1 (which should be the latest before WP5)
The html output on the edit post page stops abruptly as follows:
<!DOCTYPE html>
<!--[if IE 8]>
<html xmlns="http://www.w3.org/1999/xhtml" class="ie8 wp-toolbar" lang="en-US">
<![endif]-->
<!--[if !(IE 8) ]><!-->
<html xmlns="http://www.w3.org/1999/xhtml" class="wp-toolbar" lang="en-US">
<!--<![endif]-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Edit Post ‹ Theremin Academy — WordPress</title>
<script type="text/javascript">
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
var ajaxurl = '/wp-admin/admin-ajax.php',
pagenow = 'post',
typenow = 'post',
adminpage = 'post-php',
thousandsSeparator = ',',
decimalPoint = '.',
isRtl = 0;
</script>
<meta name="viewport" content="width=device-width,initial-scale=1.0">
from agb.plugin.
Found the bug !
I use a function that was introduced on WP 5.0, so I must check it before.
It seems to work but I need further testing.
you can add this code to classes/WP/Gutenberg.php, line 49 (Get translation) and replace the line by theses 3 :
if ( function_exists('wp_set_script_translations') ) { wp_set_script_translations( Consts::BLOCKS_SCRIPT, 'advanced-gutenberg-blocks' ); }
from agb.plugin.
That fixed it, thank you!
Now I can see that the Google Maps plugin has still a problem. Backend works well, front end is still blank with a javascript error because of misplaced html <p>
tags in the javascript:
<div class="wp-block-advanced-gutenberg-blocks-gmap">
<script>
function initMap1452836225() {</p>
<p> var coords = { lat: 51.66094, lng: 8.348746 }</p>
<p> var map = new google.maps.Map( document.querySelector( '#gutenblock-gmap-1452836225' ), {
zoom: 15,
center: coords,
styles: "default" } );</p>
<p> var marker = new google.maps.Marker( {
position: coords,
map: map
} );</p>
<p> var infoWindow = new google.maps.InfoWindow( {
content: "</p>
<p><strong>Musikschule Lippstadt</strong></p>
<p>Von-Galen-Platz 1, 59557 Lippstadt, Allemagne</p>
<p>"
} )</p>
<p> marker.addListener('click', function() {
infoWindow.open( map, marker );
} )
}
</script><br />
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDEbdMf0xZbtiLpcrpWt2rNk_XDe5jNI98&callback=initMap1452836225">
</script></p>
<div class="wp-block-advanced-gutenberg-blocks-gmap__canvas" id="gutenblock-gmap-1452836225" style="height: 400px;"></div>
</div>
from agb.plugin.
Tried to remove unnecessary double line breaks from public/templates/gmap.php, which reduced the number of unwanted <p>
and </p>
tags, but that did not fix everything... There must be a rendering filter not working properly, somewhere.
from agb.plugin.
Found a workaround: Obviously, it's the <p>
tags in the "content" string variable which mess everything up, so I took them off and put a simple <br />
tag:
var infoWindow = new google.maps.InfoWindow( {
content: "<strong><?php echo htmlspecialchars($attributes['name']); ?></strong><br /><?php echo htmlspecialchars($attributes['address']); ?>"
} )
from agb.plugin.
Something seems like to add closing tags everywhere : but it's not my plugin. The outputed code is normal on my side.
Can you try to change the theme ?
Maybe a plugin that add some security?
I tried on several browser and everything was working well
It's a script tag, there shouldn't be any p in it
In case, in public/templates/gmap.php just try to add type="text/javascript" to the 2 <script> tags.
It looks like the first p is a closing tag. Sure than there are no unclosed p tags before ?
Sometimes it's just the browser adding missing tags.
If you have opened a
before (for example in code/ html/ classic block) and didn't closed it, browser will add it, and as it close it after the beginning of the script tags, it thinks that thee was just text.
Please try and tell me !
from agb.plugin.
Ok, it's not your gmap block itself...
It happens with other themes, too. But it doesn't happen on a blank post or page. It happens only when several post blocks (I regularly use 5 of these) are in the same post or page. 2 of them do not break everything, but 3 do. Thus I'll have to have a closer look onto these posts.
But it's not as simple as an open or closed tag, because the problem appears, too, when such a "breaking" post block is inserted after/below the gmap plugin.
from agb.plugin.
Ok so there seems to be a pattern, I'll check on my side too. If we find the pattern, we find the bug.
from agb.plugin.
Ok, could narrow it down:
- create a new empty post, give it a title and publish
- create a new page
- add a Google Map Block (check with preview but this should always work without problems)
- add a Post Block and link it to your previously created post
- save draft and check with preview
You'll see that the Gmap block is blank. Look at the source code of the page and you will see that a</p>
has been automatically inserted by the browser at the line where
var infoWindow = new google.maps.InfoWindow( {
content: "</p>
is located. And the browser will tell you "Syntax error: Unexpected EOF.
That does not explain why a few posts can be used in the Post block without breaking the Gmap block, though...
And that does not also explain why everything is fine when I remove the <p>
and </p>
tags from the InfoWindow template code and put a simple <br />
instead...
Hope this helps.
from agb.plugin.
Checked if this was related to the PHP short_open_tag directive: no change.
Will now stay with my <br />
fix:
var infoWindow = new google.maps.InfoWindow( {
content: "<strong><?php echo htmlspecialchars($attributes['name']); ?></strong><br /><?php echo htmlspecialchars($attributes['address']); ?>"
} )
from agb.plugin.
just had the same problem in our WP 4.9.8 after I did the plugin update that I was informed by the WP installation.
After deactivating your original line 49 and adding your mentioned your "if ( function_exists('wp_set_script_translations') ) { wp_set_script_translations( Consts::BLOCKS_SCRIPT, 'advanced-gutenberg-blocks' ); }" it is working again. ;-)
from agb.plugin.
Fixed in 1.4.4 release
from agb.plugin.
Related Issues (20)
- WordPress plugin card block : can't select plugin HOT 3
- Website Card Preview HOT 3
- Invalid wordpress action: Stops other plugin installs from working HOT 1
- Post block - Undefined variable when WP_DEBUG true and author toggle selected HOT 2
- Currency position does not reflect WooCommerce option HOT 1
- Code block doesn't display correctly on frontend HOT 6
- F# can only be shown as mllike, disregards mime
- Error with Gutenberg 7.2.0: Block validation: Block validation failed for `core/html` HOT 6
- Additional css classes ignored? HOT 1
- Could you please use spaces or tabs HOT 4
- Undo doesn't work with Table of Contents block HOT 3
- Support for YAML with code block
- CodeMirror is not defined
- Some themes override color/margin/padding in advanced blocks HOT 2
- card: replacing opengraph API dependency HOT 3
- Lack of proper sanitization for echo function
- Code line highlight by numbers and not range
- Fatal error: Uncaught Error: Attempt to modify property "registered_blocks" on null in /wp-content/plugins/advanced-gutenberg-blocks/classes/Services/Blocks.php:51 HOT 1
- Plugin no longer in wordpress.org - gets flagged by WordFence HOT 1
- Fatal Error Occuring HOT 2
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 agb.plugin.