Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vijaycs85’s picture

Title: Copy of Convert block_admin_add() in block.admin.inc to the new form interface » Convert block_admin_add() in block.admin.inc to the new form interface
RoSk0’s picture

Assigned: Unassigned » RoSk0
Status: Active » Needs review
FileSize
2.89 KB

Initial patch.

dawehner’s picture

You want to use the magic in the routing definition:

views_ui.add:
  pattern: '/admin/structure/views/add'
  defaults:
    _entity_form: 'view.add'
  requirements:
    _permission: 'administer views'

With that you should be able to do everything without an extra controller.

RoSk0’s picture

Status: Needs review » Needs work

The last submitted patch, convert_block_admin_add_to_controller-1983874-2.patch, failed testing.

InternetDevels’s picture

Assigned: RoSk0 » InternetDevels

We are working today with this issue during Code Sprint UA

InternetDevels’s picture

Status: Needs work » Needs review
dawehner’s picture

+++ b/core/modules/block/lib/Drupal/block/BlockAddController.phpundefined
@@ -0,0 +1,30 @@
+class BlockAddController {
...
+  public function blockAddRender($plugin_id, $theme) {

Is there maybe a better name for this method/class? Please move this file into the Controller directory instead of the rootnamespace.

+++ b/core/modules/block/lib/Drupal/block/BlockAddController.phpundefined
@@ -0,0 +1,30 @@
+   $entity = entity_create('block', array(
+     'plugin' => $plugin_id,
+     'theme' => $theme,
+   ));

In a perfect world this controller would get the entity manager injected and use ->getStorageController('block')->create(...) instead of entity_create.

InternetDevels’s picture

Here are the fixes. Please review.

naxoc’s picture

Status: Needs review » Needs work
Issue tags: +WSCCI-conversion

The last submitted patch, block-convert-block-admin-add-to-controller-1983874-9.patch, failed testing.

vijaycs85’s picture

Status: Needs work » Needs review
FileSize
3.9 KB

Re-rolling...

Status: Needs review » Needs work

The last submitted patch, 1983874-convert_block_admin_add_to_controller-12.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
FileSize
919 bytes
3.93 KB

Let's fix it but also not use a global method anymore.

pguillard’s picture

Assigned: Unassigned » pguillard
pguillard’s picture

Assigned: pguillard » Unassigned

It seems ok to me!

pguillard’s picture

Status: Needs review » Reviewed & tested by the community

Forgot to set rtbc

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 54e9f29 and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.