Comments

aburrows’s picture

Assigned: Unassigned » aburrows
kshama_deshmukh’s picture

Assigned: aburrows » kshama_deshmukh
Issue tags: +LONDON_2013_APRIL
vijaycs85’s picture

Thanks to @larowlan for quick information how to handle this form. Updating IRC conversation for the self note

[12:46] <larowlan> vijaycs85: http://drupal.org/node/1978946
[12:46] <Druplicon> http://drupal.org/node/1978946 => #1978946: Convert comment_edit_page() to a Controller => Drupal core, comment.module, normal, reviewed & tested by the community, 8 comments, 2 IRC mentions
[12:46] <vijaycs85> larowlan: sure will move on to add later :)
[12:46] <larowlan> see that for an example
[12:47] <larowlan> edit is straight forward
[12:47] <larowlan> add not so (eg http://drupal.org/node/1978166)
vijaycs85’s picture

Status: Active » Needs review
Issue tags: -LONDON_2013_APRIL
StatusFileSize
new2.62 KB

Initial patch...

Status: Needs review » Needs work

The last submitted patch, 1981144-block-edit-to-controller-4.patch, failed testing.

aspilicious’s picture

+++ b/core/modules/block/block.admin.incundefined
@@ -54,36 +54,6 @@ function block_admin_add($plugin_id, $theme) {
-  // Get the theme for the page title.
-  $admin_theme = config('system.theme')->get('admin');
-  $themes = list_themes();
-  $theme_key = $entity->get('theme');
-  $theme = $themes[$theme_key];
-  // Use meaningful titles for the main site and administrative themes.
-  $theme_title = $theme->info['name'];
-  if ($theme_key == config('system.theme')->get('default')) {
-    $theme_title = t('!theme (default theme)', array('!theme' => $theme_title));
-  }
-  elseif ($admin_theme && $theme_key == $admin_theme) {
-    $theme_title = t('!theme (administration theme)', array('!theme' => $theme_title));
-  }
-
-  // Get the block label for the page title.
-  drupal_set_title(t("Configure %label block in %theme", array('%label' => $entity->label(), '%theme' => $theme_title)), PASS_THROUGH);

You need to move this to the block entity form controller. As it isn't executed at this moment.

kgoel’s picture

Assigned: kshama_deshmukh » kgoel
kgoel’s picture

Status: Needs work » Needs review
StatusFileSize
new2.61 KB

Status: Needs review » Needs work

The last submitted patch, 1981144-block-admin-edit-controller-8.patch, failed testing.

kgoel’s picture

Status: Needs work » Needs review
StatusFileSize
new4.58 KB
new5.99 KB

This patch includes conversion of block_admin_edit and also, user/1 was getting access denied while accessing admin/structure/block/manage because of return false if $operation was not view in BlockAccessController.php. This patch corrects access denied issue.

There was /configure in the URL (admin/structure/block/manage/bartik.login), which was removed from the URL after talking with Tim Plunkett.

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

The last submitted patch, 1981144-block-admin-edit-controller-10.patch, failed testing.

rgristroph’s picture

Status: Needs work » Needs review

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

The last submitted patch, 1981144-block-admin-edit-controller-10.patch, failed testing.

tim.plunkett’s picture

I believe this is blocked on #2006636: menu_contextual_links() will always return a link to the MENU_DEFAULT_LOCAL_TASK, never the parent. The offending links are being generated by contextual links.

tim.plunkett’s picture

Status: Needs work » Needs review
StatusFileSize
new4.65 KB

Okay, that went in.

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

The last submitted patch, block-1981144-15.patch, failed testing.

tim.plunkett’s picture

Status: Needs work » Needs review

#15: block-1981144-15.patch queued for re-testing.

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

The last submitted patch, block-1981144-15.patch, failed testing.

tim.plunkett’s picture

Status: Needs work » Needs review
StatusFileSize
new720 bytes
new5.36 KB

Last one!

dawehner’s picture

+++ b/core/modules/block/lib/Drupal/block/BlockAccessController.phpundefined
@@ -22,7 +22,7 @@ class BlockAccessController extends EntityAccessController {
     // Currently, only view access is implemented.
...
-      return FALSE;
+      return user_access('administer blocks', $account);
     }

So we also have update access now?

kgoel’s picture

@dawehner - can you elaborate this little more?

So we also have update access now?

dawehner’s picture

Currently, only view access is implemented.

This text is not true anymore.

kgoel’s picture

StatusFileSize
new4.69 KB

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

The last submitted patch, block-1981144-23.patch, failed testing.

kgoel’s picture

Status: Needs work » Needs review

#23: block-1981144-23.patch queued for re-testing.

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

The last submitted patch, block-1981144-23.patch, failed testing.

naxoc’s picture

Status: Needs work » Needs review
StatusFileSize
new4.69 KB

Here is a reroll.

Status: Needs review » Needs work

The last submitted patch, block-1981144-27.patch, failed testing.

stella’s picture

Status: Needs work » Needs review
StatusFileSize
new2.55 KB
new4.74 KB

Patch reroll

Status: Needs review » Needs work

The last submitted patch, 1981144-block_admin_edit-27.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new5.44 KB
new720 bytes

This should be possible to fix.

ParisLiakos’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

looks good but needs a reroll

disasm’s picture

Status: Needs work » Needs review
StatusFileSize
new4.9 KB

reroll!

dawehner’s picture

+++ b/core/modules/block/block.admin.incundefined
@@ -22,6 +22,25 @@ function block_admin_demo($theme = NULL) {
 /**
+ * Page callback: Build the block instance add form.
+ *
+ * @param string $plugin_id
+ *   The plugin ID for the block instance.
+ * @param string $theme
+ *   The name of the theme for the block instance.
+ *
+ * @return array
+ *   The block instance edit form.
+ */
+function block_admin_add($plugin_id, $theme) {
+  $entity = entity_create('block', array(
+    'plugin' => $plugin_id,
+    'theme' => $theme,
+  ));
+  return Drupal::entityManager()->getForm($entity);
+}

This hunk looks unrelated and wrong.

disasm’s picture

Wow, that was a mistake. Not only did I add back block_admin_add, but I failed to remove block_admin_edit callback!

See interdiff.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Ha!

yesct’s picture

Issue tags: -Needs reroll +RTBC July 1

This issue was RTBC and passing tests on July 1, the beginning of API freeze.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.x, thanks!

tstoeckler’s picture

I don't see #6 being discussed anywhere here. I thought the same thing when I saw this in the commitlog. Why is it safe to simply remove all that code?

Status: Fixed » Closed (fixed)

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

mradcliffe’s picture

I've added a follow-up issue related to the default local task that isn't converted and results in a page not found.

#2052019: Fix block configuration default local task to use block_admin_edit route