WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.54k stars 4.21k forks source link

I cant save this block of code #19658

Closed ghost closed 4 years ago

ghost commented 4 years ago

Describe the bug I marked the new block as Code block... then I pasted this code of ES6 To reproduce 1.- I created a code block 2.- I pasted `function tableReady(arr) { var nextIndex = 0; return { next() { if(nextIndex < arr.length) { return {value: arr.shift(), done: false} } else { return {done: true} } } } }

    var waitingList = ['Sarah', 'Heather', 'Anna', 'Meagan'];
    var iterateList = tableReady(waitingList);

    console.log(`${iterateList.next().value}, your table is ready`);
    console.log(`${iterateList.next().value}, your table is ready`);
    console.log(`${iterateList.next().value}, your table is ready`);
    console.log(`${iterateList.next().value}, your table is ready`);
    console.log(`Is this finished? ${iterateList.next().done}`);

</script>
<title>Iterators</title>

` 3.- I clicked update (post)

Expected behavior Saved and Updated content

Screenshots There is no error... just "time out"

Desktop (please complete the following information):

Additional context Wordpress version: 5.2.5

youknowriad commented 4 years ago

I don't have any issue with the same code above. Do you have any plugins that could cause conflicts?

ghost commented 4 years ago

I dont think so. It was just a timeout. Same day, I posted a lot of other codes blocks. http://ntala.chinchillareactor.com/index.php/2020/01/15/

and the only one impossible (to be saved) was this one.. http://ntala.chinchillareactor.com/index.php/2020/01/15/ecmascript6-011-iterators/

What do you need?

ghost commented 4 years ago

UPDATED: After cutting it...this is the isolated code who is giving me so much trouble:

promise. then(function () { console.log('Success, You are a GEEK'); }). catch(function () { console.log('Some error has occured'); });

Even if I save it as a codeblock... the post cant be updated and a timeout error appears

youknowriad commented 4 years ago

Just tested again and I'm still not able to reproduce. Maybe this was fixed in the last versions of Gutenberg. Can you try with the plugin and see?

ghost commented 4 years ago

Gentlemen, If this cant be reproduced in the newer version of guttenber, it is fine. But i won't update my wordpress sites again. The latest destroyed everything in 3 of them. bugs everywhere.

how can I upgrade guttenberg... but able to rollback if it is needed?

ghost commented 4 years ago

Ok, updated everything. However, it still there.

these are the plugins I'm using:

youknowriad commented 4 years ago

The most suspect plugin for me is "WP Security Audit Log" but that's not certain. You can consider using https://wordpress.org/plugins/health-check/ to test disabling your plugins without affecting your visitors.

ghost commented 4 years ago

Fixed. I updated the PHP in the apache2 in the VM (google cloud)... from 7.0 to 7.3 and after that I was able to update the post with this code:

promise. then(function () { console.log('Success, You are a GEEK'); }). catch(function () { console.log('Some error has occured'); });

So I think that was the reason

ghost commented 4 years ago

Verified... Now I was able to update this one too: `<!DOCTYPE html>

Iterators ` It is the PHP version. I mean, I installed the new php and ran a full "apt-get upgrade/update"
youknowriad commented 4 years ago

I'm not certain it was the php version personally, but you probably had a php error somewhere in your code that got fixed with the update.