Closed (fixed)
Project:
Examples for Developers
Version:
8.x-1.x-dev
Component:
Block Example
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
12 Jun 2012 at 21:14 UTC
Updated:
22 Jun 2013 at 18:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
alberto56 commentedHere is a patch
Comment #2
pcambraBlocks are plugins now and the code above will need to be adapted.
Change notice: http://drupal.org/node/1880620
Comment #3
pcambraJust an update of progress, mostly some thoughts on this
I guess we need an example of Derivatives too: http://drupal.org/node/1653226
Also the usage shown in the example module for hook_block_list_alter is quite weird, that hook has been removed in the plugin conversion by a hook_block_access so I guess we need to alter the example.
Additionally, hook_block_view_alter() has been refurbished a little in favor of hook_block_view_ID_alter() and hook_block_view_NAME_alter() but it remains around so we'd need the three of them included.
Related: #1874576: Improve the documentation and naming of hook_block_view_alter() hooks
Comment #4
pcambraAnother blocker in the way #1899772: Fix name retrieving for block plugins to fix hook_block_view_NAME_alter()
Comment #5
ybabel commentedFor the Drupal Global Sprint I worked on porting block example module to Drupal 8.
The 3 blocks works (empty / configurable_text / uppercase).
I did not found how to translate all the plugin anotations. Theses ones are not yet recognized :
I did not found how to implement block_example_block_view_alter correctly.
I tried something like that :
Tests not ported yet.
Comment #6
alberto56 commented@ybabel
thanks. However you might have provided the wrong file: the patch provided is identical to the one in comment #1.
Comment #7
ybabel commentedright ! my mistake.
here is the good patch
Comment #9
ybabel commentedmy patch didn't work because DBTNG and page_example are outdated ... I didn't work on them though.
But it work.
Comment #10
ybabel commentedtests added, and patch updated
Comment #12
ybabel commentedComment #13
rfay#12: 1630760-4-block-example-module.patch queued for re-testing.
Comment #15
marvil07 commentedSeveral changes to pass tests again.
hook_block_view_alter()to reflect the new type of the second parameter. Also re-insert the behaviour from D7 version.Drupal\block_example\Plugin\Blocknamespace instead ofDrupal\block_example\Plugin\block\block.blockAccess()implementations since parent class does the same.blockBuild()instead ofbuild(), since that's the common case.'setting[label]'on block settings form pages.This will probably need another round of documentation changes, but it's running tests locally, let's see what bot thinks.
PS: Also, I fixed first the other already added modules related with the type key on info files change.
Comment #16
marvil07 commentedSome final changes for test to re-try before adding it.
Comment #18
marvil07 commented#16: 1630760-16.patch queued for re-testing.
Comment #19
marvil07 commentedLast patch added to 8.x-1.x.
Thank you all for the contributions here!
Also special thanks to timplunkett and xjm for the final hints ;-)