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

Update blocks to work with Gutenberg v5.1.1 and/or WordPress 5.0.3 / 5.1 #15

Closed
bobbingwide opened this issue Oct 22, 2018 · 11 comments
Closed
Assignees
Labels
bug Something isn't working enhancement New feature or request Priority A High Priority

Comments

@bobbingwide
Copy link
Owner

bobbingwide commented Oct 22, 2018

It's been some time since I built the code with Gutenberg. It was last built with 2.9.2. There have been many changes since, with code being deprecated and so on.
Some of the blocks no longer work. They need fixing. I'll use the original issues for each block, adding a comment on each on that doesn't yet work.
Some of the blocks may be rewritten to reflect a better way of implementing the code in the first place.

Block Issue Status v5.1.1
oik-address #5 Already works
oik-contact-form #7 Already works
oik-googlemap #3 Already works
oik-countdown #9 Works
oik-css #13 Works
oik-csv #2 Works
oik-person #6 Works
github #4 Works
oik-nivo #10 Works
generic shortcode block #11 in development
oik-follow-me #8 Not working properly - sidebar panels not displayed

Note: Issue references needed updating after the issues were transferred from oik-block to oik-blocks. Labels also need re-creating.

@bobbingwide bobbingwide self-assigned this Oct 22, 2018
@bobbingwide
Copy link
Owner Author

The code should work with Gutenberg v.4.1.0 when it's released. Currently v4.1.0-rc.2

@bobbingwide
Copy link
Owner Author

It would be nice if the JavaScript ( .js ) code was documented according to WordPress's JavaScript Documentation Standards. https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/javascript/

e.g. For the start of each file

/**
 * Summary. 
 *
 * Description.
 *
 * @copyright (C) Copyright Bobbing Wide 2018
 * @author @bobbingwide
 */

Not sure if it's necessary to use @url, @link or others. What about @Package?

@bobbingwide bobbingwide changed the title Update blocks to work with Gutenberg v4.0.0 Update blocks to work with Gutenberg v4.1.1 and/or WordPress 5.0-beta2 Oct 30, 2018
@bobbingwide
Copy link
Owner Author

bobbingwide commented Nov 16, 2018

oik-block is not working at all on WordPress 5.0-beta5 on my new laptop with Edge.
Could be due to a problem with oik-bwtrace… which is not installed.

<b>Warning</b>:  require_once(C:/apache/htdocs/wordpress/wp-content/plugins/oik-bwtrace/includes/bwtrace-actions.php): 
failed to open stream: No such file or directory in 
<b>C:\apache\htdocs\wordpress\wp-content\plugins\oik\libs\oik_boot.php</b> on line <b>70</b><br />

It was. Workaround was to install oik-bwtrace. It didn't need activating.

@bobbingwide bobbingwide changed the title Update blocks to work with Gutenberg v4.1.1 and/or WordPress 5.0-beta2 Update blocks to work with Gutenberg v4.4 and/or WordPress 5.0-beta5 Nov 18, 2018
bobbingwide referenced this issue in bobbingwide/oik-block Nov 18, 2018
@bobbingwide
Copy link
Owner Author

bobbingwide commented Nov 19, 2018

With WordPress 5.0-beta5 but NOT Gutenberg the Github Issue block produces a Console log message and none of the oik-block blocks load.

Uncaught TypeError: Cannot read property 'TextControl' of undefined
    at eval (index.js?7662:25)
    at Object.<anonymous> (editor.blocks.js?ver=1542566507:595)
    at __webpack_require__ (editor.blocks.js?ver=1542566507:20)
    at eval (index.js?8193:1)
    at Object.<anonymous> (editor.blocks.js?ver=1542566507:588)
    at __webpack_require__ (editor.blocks.js?ver=1542566507:20)
    at editor.blocks.js?ver=1542566507:63
    at editor.blocks.js?ver=1542566507:66

I mentioned this on Slack and was told I needed to add dependencies on the script registration. I needed to add wp.components and wp.editor to make it work in native WordPress 5.0-beta5.
wp-editor needed for Editable used by the Person block.

@bobbingwide
Copy link
Owner Author

It turns out that the real problem was that my code was registering the editor blocks on the front end. This also caused a problem with Autoptimize. The fix is applied in https://github.com/bobbingwide/oik-blocks

@bobbingwide bobbingwide transferred this issue from bobbingwide/oik-block Nov 23, 2018
@bobbingwide bobbingwide changed the title Update blocks to work with Gutenberg v4.4 and/or WordPress 5.0-beta5 Update blocks to work with Gutenberg v4.5.1 and/or WordPress 5.0-RC1 Nov 30, 2018
@bobbingwide
Copy link
Owner Author

When responding to enqueue_block_editor_assets the code currently checks if we’re doing_filter( ‘editor_replace’ ). This test only works when Gutenberg is activated. The need for the test, to avoid enqueuing the blocks when loading the Classic editor, is no longer necessary. So the test should be removed.

@bobbingwide bobbingwide added bug Something isn't working enhancement New feature or request Priority A High Priority labels Nov 30, 2018
bobbingwide added a commit that referenced this issue Dec 12, 2018
@bobbingwide bobbingwide changed the title Update blocks to work with Gutenberg v4.5.1 and/or WordPress 5.0-RC1 Update blocks to work with Gutenberg v4.7 and/or WordPress 5.0.1 Dec 13, 2018
@bobbingwide
Copy link
Owner Author

I noticed a major problem when WordPress SEO was activated.
Autosave never seemed to finish.
In the console log there was a 500 response occurring.
This was due to logic in oik_blocks_editor_scripts() that was testing if the Classic Editor was being loaded. It seems that in conversion from Gutenberg to 5.0 the enqueue_block_editor_assets action is called for requests to display the WordPress SEO metabox.

/wp-admin/post.php?meta_box=1&action=edit&classic-editor&post=31818

The logic should not fail in this instance. Either we update the check or simply remove the ( debugging ) call to the missing function gob().

@bobbingwide bobbingwide changed the title Update blocks to work with Gutenberg v4.7 and/or WordPress 5.0.1 Update blocks to work with Gutenberg v4.7.1 and/or WordPress 5.0.2 Jan 3, 2019
@bobbingwide
Copy link
Owner Author

Gutenberg 4.8.0 was released on 7th/8th Jan 2019. WordPress 5.0.3 on 9th Jan.

@bobbingwide
Copy link
Owner Author

It's about time we switched from alpha versions to proper semantic numbering. The next version, delivering the Block info block will be 0.2.0.
This version won't be on WordPress.org since there are still many blocks that Need work.

@bobbingwide bobbingwide changed the title Update blocks to work with Gutenberg v4.7.1 and/or WordPress 5.0.2 Update blocks to work with Gutenberg v5.0 and/or WordPress 5.0.3 / 5.1-RC1 Feb 11, 2019
@bobbingwide bobbingwide changed the title Update blocks to work with Gutenberg v5.0 and/or WordPress 5.0.3 / 5.1-RC1 Update blocks to work with Gutenberg v5.1.1 and/or WordPress 5.0.3 / 5.1 Feb 28, 2019
@bobbingwide
Copy link
Owner Author

bobbingwide commented Feb 28, 2019

The table should be updated to reflect the status for all the blocks under development for oik-blocks and their operational status with Gutenberg 5.1.1 and WordPress 5.1

@bobbingwide
Copy link
Owner Author

Closing this as I'm now retesting the most recent version of the blocks with WordPress 5.9 and/or Gutenberg 12.3.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request Priority A High Priority
Projects
None yet
Development

No branches or pull requests

1 participant