Sub issue of #1823450: [Meta] Convert core listings to Views

Problem/Motivation

Shortcut block can be converted to view.

Beta phase evaluation

This is appropriate for 8.0.x.

It is a major task that has impact greater than disruption, so it can proceed in 8.0.x.

Reference: https://www.drupal.org/core/beta-changes
Issue category Task because the functionality of these listings is already in core (with custom code)
Issue priority Major because this Meta is about replacing core listings in many places, across systems, and has community consensus for being important. Not critical because we can release 8.0.0 without completing the conversion to views and do it in a later release. Keeping the custom code (not converting a listing) will not cause severe performance or usability regressions.
Prioritized changes A bit, it maybe would reduce fragility by re-using views code and getting rid of custom listing code.
Disruption It will not be disruptive for core/contributed and custom modules/themes because it will not require a BC break/deprecation/widespread changes since changes are isolated to core listing custom code.

Proposed resolution

Create a view for shortcut block.

The original scope was to replace the existing block with a view but that changed, see #70 - #73.

Remaining tasks

Fix core/tests/Drupal/FunctionalTests/Core/Recipe/StandardRecipeTest.php
Review

User interface changes

API changes

None

CommentFileSizeAuthor
#90 shortcut-view-updated1.patch11.59 KBsivakarthik229
#89 shortcut-view-updated.patch11.6 KBsivakarthik229
#87 shortcuts-view.patch11.59 KBsivakarthik229
#67 convert_shortcut_block-2502151-67.patch26.91 KBjibran
#67 interdiff.txt886 bytesjibran
#63 convert_shortcut_block-2502151-63.patch26.91 KBjibran
#63 interdiff.txt515 bytesjibran
#60 convert_shortcut_block-2502151-60.patch26.98 KBjibran
#60 interdiff.txt4.52 KBjibran
#58 convert_shortcut_block-2502151-58.patch22.46 KBjibran
#56 convert_shortcut_block-2502151-56.patch186.85 KBjibran
#56 interdiff.txt4.4 KBjibran
#55 shortcuts-views.png6.3 KBtstoeckler
#55 shortcut-current.png6.22 KBtstoeckler
#52 convert_shortcut_block-2502151-51.patch22.37 KBjibran
#52 interdiff.txt819 bytesjibran
#47 convert_shortcut_block-2502151-47.patch22.37 KBjibran
#43 shortcut-views-2502151.43.patch22.6 KBlarowlan
#40 convert_shortcut_block-2502151-40.patch22.64 KBjibran
#40 interdiff.txt2.36 KBjibran
#39 convert_shortcut_block-2502151-39.patch23.19 KBjibran
#39 interdiff.txt2.73 KBjibran
#35 convert_shortcut_block-2502151-35.patch20.46 KBjibran
#35 interdiff.txt624 bytesjibran
#35 interdiff.txt733 bytesjibran
#33 convert_shortcut_block-2502151-33.patch20.51 KBjibran
#33 interdiff.txt2.14 KBjibran
#30 interdiff.txt2.17 KBlauriii
#30 convert_shortcut_block-2502151-30.patch20.22 KBlauriii
#25 convert_shortcut_block-2502151-25.patch20.25 KBjibran
#25 interdiff.txt882 bytesjibran
#22 interdiff-22.txt465 bytesjoshi.rohit100
#22 2502151-22.patch20.18 KBjoshi.rohit100
#20 interdiff-20.txt447 bytesjoshi.rohit100
#20 2502151-20.patch20.18 KBjoshi.rohit100
#18 2502151-shortcut-block-view.png11.25 KBkattekrab
#17 convert_shortcut_block-2502151-17.patch20.18 KBjibran
#17 interdiff.txt8.64 KBjibran
#15 convert_shortcut_block-2502151-15.patch17.11 KBjibran
#15 interdiff.txt1.26 KBjibran
#14 convert_shortcut_block-2502151-14.patch18.74 KBjibran
#14 convert_shortcut_block-2502151-14-do-not-test.patch17.12 KBjibran
#14 interdiff.txt662 bytesjibran
#12 convert_shortcut_block-2502151-12.patch18.73 KBjibran
#12 convert_shortcut_block-2502151-12-do-not-test.patch17.11 KBjibran
#12 interdiff.txt1.02 KBjibran
#9 convert_shortcut_block-2502151-9.patch17.78 KBjibran
#9 interdiff.txt4.94 KBjibran
#7 convert_shortcut_block-2502151-7.patch13.78 KBjibran
#7 interdiff.txt636 bytesjibran
#5 convert_shortcut_block-2502151-3.patch13.16 KBjibran
#3 convert_shortcut_block-2502151-3.patch13.16 KBjibran
#3 interdiff.txt2 KBjibran
screenshot-d8.dev 2015-06-08 09-29-10.png5.38 KBjibran
screenshot-d8.dev 2015-06-08 09-29-01.png5.3 KBjibran
convert-shortcutblock-to-view.patch11.65 KBjibran

Issue fork drupal-2502151

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jibran’s picture

Component: views.module » shortcut.module
Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, convert-shortcutblock-to-view.patch, failed testing.

jibran’s picture

Status: Needs work » Needs review
StatusFileSize
new2 KB
new13.16 KB

Fixed the test fails.

Status: Needs review » Needs work

The last submitted patch, 3: convert_shortcut_block-2502151-3.patch, failed testing.

jibran’s picture

Status: Needs work » Needs review
StatusFileSize
new13.16 KB

Re-uploading...

Status: Needs review » Needs work

The last submitted patch, 5: convert_shortcut_block-2502151-3.patch, failed testing.

jibran’s picture

Status: Needs work » Needs review
StatusFileSize
new636 bytes
new13.78 KB

This should be green.

Status: Needs review » Needs work

The last submitted patch, 7: convert_shortcut_block-2502151-7.patch, failed testing.

jibran’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new4.94 KB
new17.78 KB

Now with functional test.

jibran’s picture

Fix Link Formatter issue. It passes NULL as options of shortcut link and it causes an error in UrlLinkGenerator. Needs follow up.

Created #2502913: Link field default options values should be array for this.

This is ready for review.

tstoeckler’s picture

Thanks @jibran. Will try it out, but from looking at it looks great so far!

jibran’s picture

StatusFileSize
new1.02 KB
new17.11 KB
new18.73 KB

Merged #2502913: Link field default options values should be array in it. Do not test patch is without the changes of #2502913. Have done minor cleanup interdiff included.

Thanks for having a look at it @tstoeckler

Status: Needs review » Needs work

The last submitted patch, 12: convert_shortcut_block-2502151-12.patch, failed testing.

jibran’s picture

Status: Needs work » Needs review
StatusFileSize
new662 bytes
new17.12 KB
new18.74 KB

Fixed the test.

jibran’s picture

StatusFileSize
new1.26 KB
new17.11 KB
dawehner’s picture

  1. +++ b/core/modules/shortcut/config/schema/shortcut.views.schema.yml
    @@ -0,0 +1,8 @@
    +# Schema for the views plugins of the Shortcut module.
    +
    +views.argument_default.current_shortcut_set:
    +  type: sequence
    +  label: 'Shortcut set assigned to current user'
    +  sequence:
    +    type: string
    +    label: 'Shortcut set'
    
    +++ b/core/modules/shortcut/src/Plugin/views/argument_default/CurrentShortcutSet.php
    @@ -0,0 +1,45 @@
    + *
    + * This plugin actually has no options so it does not need to do a great deal.
    + *
    

    That comment seems a bit pointless, if you ask me, but the actual thing is that you should not need config schema in case there is no config ... it should inherit things automatically.

  2. +++ b/core/modules/shortcut/src/Entity/Shortcut.php
    @@ -25,6 +25,7 @@
      *     "access" = "Drupal\shortcut\ShortcutAccessControlHandler",
    + *     "views_data" = "Drupal\views\EntityViewsData",
      *     "form" = {
    

    OOH, yes! <3

  3. +++ b/core/modules/shortcut/src/Plugin/views/argument_default/CurrentShortcutSet.php
    @@ -0,0 +1,45 @@
    + * Default argument plugin to extract the current shortcut
    

    .

  4. +++ b/core/modules/shortcut/src/Plugin/views/argument_default/CurrentShortcutSet.php
    @@ -0,0 +1,45 @@
    +  public function getArgument() {
    

    {@inheritdoc}

  5. +++ b/core/modules/shortcut/tests/src/Functional/ShortcutBlockTest.php
    @@ -0,0 +1,55 @@
    +class ShortcutBlockTest extends BrowserTestBase {
    

    Oh wow, this actually works?

  6. +++ b/core/modules/simpletest/src/BrowserTestBase.php
    @@ -1339,4 +1339,64 @@ protected function drupalUserIsLoggedIn(UserInterface $account) {
    +  protected function drupalPlaceBlock($plugin_id, array $settings = array()) {
    

    Would it be possible to move the existing code to a trait instead?

jibran’s picture

StatusFileSize
new8.64 KB
new20.18 KB

Fixed #16. Thanks for the review @dawehner

kattekrab’s picture

Issue summary: View changes
StatusFileSize
new11.25 KB

And a manual test - works pretty nicely.

I was even able to edit the view, switch from HTML list to grid.

kattekrab’s picture

Status: Needs review » Needs work
+++ b/core/modules/shortcut/config/optional/views.view.shortcuts.yml
@@ -0,0 +1,280 @@
+description: Shortcuts

nitpick: All the other view descriptions end with a full stop. This probably should too.

joshi.rohit100’s picture

Status: Needs work » Needs review
StatusFileSize
new20.18 KB
new447 bytes
dawehner’s picture

+++ b/core/modules/shortcut/config/optional/views.view.shortcuts.yml
@@ -0,0 +1,280 @@
+      cache:
+        type: none
+        options: {  }

Let's cache the view ...

joshi.rohit100’s picture

StatusFileSize
new20.18 KB
new465 bytes
moshe weitzman’s picture

+ cacheable: false

There are a couple instances of this. Not sure if it matters.

kattekrab’s picture

Just did another manual test. Still works!

Does the cacheable thing matter?

No? Let's RTBC this.
Yes? Back to needs work for a tidy-up.

:)

Nice work everyone.

jibran’s picture

StatusFileSize
new882 bytes
new20.25 KB

@moshe weitzman I checked the default taxonomy term view it also has the same situation so I think it doesn't matter. @kattekrab the answer is no so it can be RTBC.
Thank you @joshi.rohit100 for the quick fixes.
Meanwhile updated the shortcut description and added a category to the view.

kattekrab’s picture

+++ b/core/modules/shortcut/config/optional/views.view.shortcuts.yml
@@ -0,0 +1,282 @@
+description: 'Shortcuts block.'

Yes. That's better. Just "Shortcuts." had been bugging me.

Do we need a change record for this?

jibran’s picture

There is one https://www.drupal.org/node/2084727 already we can update it after the commit.

nickdickinsonwilde’s picture

Status: Needs review » Reviewed & tested by the community

looks good to me

kattekrab’s picture

Great! RTBC++

lauriii’s picture

StatusFileSize
new20.22 KB
new2.17 KB

Sorry for jumping in on the issue :) Just fixed some inconsistency on the array syntaxes and documentation

kattekrab’s picture

Tested again. Still works!

And in the meantime, the unrelated bug I found while doing initial testing for this has been fixed and committed too! :-)
#2511024: Can't add multiple content types to shortcuts

wim leers’s picture

Status: Reviewed & tested by the community » Needs work
  1. +++ b/core/modules/shortcut/config/optional/views.view.shortcuts.yml
    @@ -0,0 +1,282 @@
    +    cache_metadata:
    +      contexts:
    +        - 'languages:language_content'
    +        - 'languages:language_interface'
    +        - url
    +        - user
    +        - user.permissions
    

    Why is it cacheable per URL? Which plugin/handler of this view causes that?

  2. +++ b/core/modules/shortcut/config/optional/views.view.shortcuts.yml
    @@ -0,0 +1,282 @@
    +      cacheable: false
    

    And which handler/plugin causes the view to be uncacheable?

  3. +++ b/core/modules/shortcut/src/Plugin/views/argument_default/CurrentShortcutSet.php
    @@ -0,0 +1,46 @@
    +  public function getCacheContexts() {
    +    return ['user'];
    +  }
    

    We should add a @todo here: it doesn't need to be cached per user, but per-current-shortcut-set. I.e. a new user.shortcut_set cache context.

    Can be follow-up of course. But right now, this unnecessarily reduces cacheability. This would point anybody interested user towards the issue where that will be improved.

Finally: this will conflict with #2464427: Replace CacheablePluginInterface with CacheableDependencyInterface.

jibran’s picture

Status: Needs work » Postponed
StatusFileSize
new2.14 KB
new20.51 KB

Thank you very much for the review @Wim Leers. I have rerolled the patch on #2464427: Replace CacheablePluginInterface with CacheableDependencyInterface. Let's postpone this on #2464427: Replace CacheablePluginInterface with CacheableDependencyInterface for now.
#32

  1. I think it's because of link__uri field.
  2. I don't know how to give a best answer to this question but I think it's because I'm rewriting the output of title field.
  3. Added a todo. Should we create a follow up as well? Why can't we fix it here?
wim leers’s picture

  1. Impossible; the cache contexts stored in the View config entity are for plugins/handlers only. Not for something that is rendered.
  2. You can figure this out by saving the view while a breakpoint is set in ::calculcateCacheMetadata(). Also for point 1.
  3. Well, we can fix it here, but I didn't want to hold this issue up on that. It's a pre-existing problem technically speaking, so it's technically out of scope here.
jibran’s picture

StatusFileSize
new733 bytes
new624 bytes
new20.46 KB

Thanks for pointing me into right direction.

  1. It's added by ArgumentPluginBase::getCacheContexts().
        // By definition arguments depends on the URL.
        // @todo Once contexts are properly injected into block views we could pull
        //   the information from there.
        $contexts[] = 'url';
  2. After having a look at #2464427-68: Replace CacheablePluginInterface with CacheableDependencyInterface I think it can be removed here as well because I changed it to true re-imported it, re-saved it and exported it and it doesn't revert my changes. Views::addCacheMetadata() doesn't take that into account it just the same value as yml file.
  3. Can we add some issue ID here?
wim leers’s picture

@jibran: awesome
@olli: THANK YOU!

jibran’s picture

Issue tags: +D8 upgrade path

We also need an upgrade path for replacing the original block with the block provided by views.

jibran’s picture

StatusFileSize
new2.73 KB
new23.19 KB

Added upgrade path rolled on replace-2464427-97-do-not-test.patch in #2464427-97: Replace CacheablePluginInterface with CacheableDependencyInterface so still postpone.

jibran’s picture

Issue tags: +Needs tests
StatusFileSize
new2.36 KB
new22.64 KB

@alexpott reviewed the patch in IRC. Thanks for the suggestions. Updated the update hook it needs update path test now.

larowlan’s picture

Can we split the BTB improvements into their own issue?

andypost’s picture

+1 to split

larowlan’s picture

StatusFileSize
new22.6 KB

Re-roll

tstoeckler’s picture

Status: Postponed » Needs review

Unblocked now. Let's see.

The last submitted patch, 40: convert_shortcut_block-2502151-40.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 43: shortcut-views-2502151.43.patch, failed testing.

jibran’s picture

Status: Needs work » Needs review
StatusFileSize
new22.37 KB

Reroll.

Status: Needs review » Needs work

The last submitted patch, 47: convert_shortcut_block-2502151-47.patch, failed testing.

The last submitted patch, 40: convert_shortcut_block-2502151-40.patch, failed testing.

The last submitted patch, 43: shortcut-views-2502151.43.patch, failed testing.

The last submitted patch, 47: convert_shortcut_block-2502151-47.patch, failed testing.

jibran’s picture

Status: Needs work » Needs review
StatusFileSize
new819 bytes
new22.37 KB

Fixed schema.

tstoeckler’s picture

Version: 8.0.x-dev » 8.1.x-dev
Issue tags: -Needs tests +Needs upgrade path tests

This is 8.1.x material now.

Code looks pretty good, mostly only have minor comments. Will take this for a spin now. Also we need tests for the upgrade path.

  1. +++ b/core/modules/shortcut/config/optional/views.view.shortcuts.yml
    @@ -0,0 +1,284 @@
    +          default_argument_type: current_shortcut_set
    +          default_argument_options: {  }
    
    +++ b/core/modules/shortcut/config/schema/shortcut.views.schema.yml
    @@ -0,0 +1,8 @@
    +views.argument_default.current_shortcut_set:
    +  type: sequence
    +  label: 'Shortcut set assigned to current user'
    +  sequence:
    +    type: string
    +    label: 'Shortcut set'
    

    This is not correct. There are actually no settings saved in the default argument handler, so the schema should not pretend there are. Let's do type: mapping and then mapping: { }

    Edit: I just looked at what other default argument plugins are doing and they are doing the same thing. So I guess we can leave it here and just update all of them together in a separate issue.

    Also found #2623548: Remove obsolete views.argument_default.php config schema :-P

  2. +++ b/core/modules/shortcut/shortcut.install
    @@ -67,3 +70,57 @@ function shortcut_uninstall() {
    + * Replace existing shortcuts block with views shortcuts block.
    

    "views" -> "Views"

  3. +++ b/core/modules/shortcut/shortcut.install
    @@ -67,3 +70,57 @@ function shortcut_uninstall() {
    +
    

    Remove this empty line.

  4. +++ b/core/modules/shortcut/shortcut.install
    @@ -67,3 +70,57 @@ function shortcut_uninstall() {
    +  // Skip the update if views and block module are not installed.
    

    "views and block" -> "Views and Block"

  5. +++ b/core/modules/shortcut/shortcut.install
    @@ -67,3 +70,57 @@ function shortcut_uninstall() {
    +  $optional_install_path = drupal_get_path('module', 'shortcut') . '/' . InstallStorage::CONFIG_OPTIONAL_DIRECTORY;
    

    Minor but you can use $module_handler->getModule('shortcut')->getPath();

  6. +++ b/core/modules/shortcut/shortcut.install
    @@ -67,3 +70,57 @@ function shortcut_uninstall() {
    +    // Only update if shortcuts block exist.
    

    "Only update shortcut blocks."

  7. +++ b/core/modules/shortcut/shortcut.install
    @@ -67,3 +70,57 @@ function shortcut_uninstall() {
    +      $block->delete();
    +      \Drupal::entityManager()
    +        ->getStorage('block')
    +        ->create($values)
    +        ->save();
    

    Is there a reason we are deleting and recreating the block instead of just updating it directly?

  8. +++ b/core/modules/shortcut/shortcut.install
    @@ -67,3 +70,57 @@ function shortcut_uninstall() {
    +    $message = \Drupal::translation()->translate('Replaced following shortcuts block with views shortcuts block: @ids', ['@ids' => implode(', ', $ids)]);
    

    shortcut block*s* and *V*iews shortcuts block*s*.

  9. +++ /dev/null
    @@ -1,41 +0,0 @@
    -class ShortcutsBlock extends BlockBase {
    

    Let's leave this as BC, now that 8.0.0 is out and just add a @deprecated

  10. +++ b/core/modules/shortcut/src/Plugin/views/argument_default/CurrentShortcutSet.php
    @@ -0,0 +1,55 @@
    +    // @todo it needs to be cached per user.shortcut_set cache context.
    

    Let's remove that @todo. hook_default_shortcut_set() does not support cache metadata currently, so being able to *properly* cache shortcut (sets) is a whole can of worms, but making it per-user is a pretty good best effort IMO, so it should be fine for now.

  11. +++ b/core/modules/shortcut/tests/src/Functional/ShortcutBlockTest.php
    @@ -0,0 +1,55 @@
    +    // Creates a block instance and place in a region through api.
    

    "place *it* in a region"

    The "through api" can be removed IMHO.

  12. +++ b/core/modules/shortcut/tests/src/Functional/ShortcutBlockTest.php
    @@ -0,0 +1,55 @@
    +      'title' => $this->randomString(),
    ...
    +    $this->getSession()->getPage()->find('css', '#block-' . $block->id());
    +    $this->getSession()->getPage()->find('css', 'a[href="/admin/structure/block"]');
    

    Maybe also assert that the shortcut title appears.

tstoeckler’s picture

tstoeckler’s picture

Status: Needs review » Needs work
StatusFileSize
new6.22 KB
new6.3 KB

Here is a comparison of the markup and some screenshots to prove that the output is the same. The added markup is just in the nature of the game of using Views, I'm not sure we can do a lot about this.

Current:
A picture of the current shortcut block in Bartik's 'Featured Top' region with the title 'Shortcuts' and the shortcut links 'Add content' and 'All content'

Views:
A picture of the new Views shortcut block in Bartik's 'Featured Top' region with the title 'Shortcuts' and the shortcut links 'Add content' and 'All content'

Current markup:

    <div id="block-shortcuts" class="contextual-region block block-shortcut block-shortcuts" role="navigation">
  
      <h2>Shortcuts</h2>
    <div role="form" class="contextual" data-contextual-id="block:block=shortcuts:langcode=en"><button aria-pressed="false" class="trigger focusable visually-hidden" type="button">Open Shortcuts configuration options</button><ul class="contextual-links" hidden=""><li class="block-configure"><a href="/admin/structure/block/manage/shortcuts?destination=user/1">Configure block</a></li></ul></div>
      <div class="content">
      <ul class="toolbar-menu"><li class="_"><a href="/node/add">Add content</a></li><li class="_"><a href="/admin/content">All content</a></li></ul>
    </div>
  </div>

Views markup:

    <div class="views-element-container contextual-region block block-shortcut block-views-blockshortcuts-shortcut-block" id="block-shortcuts" role="navigation">
  
      <h2>Shortcuts</h2>
    <div role="form" class="contextual" data-contextual-id="block:block=shortcuts:langcode=en|entity.view.edit_form:view=shortcuts:location=block&amp;name=shortcuts&amp;display_id=shortcut_block&amp;langcode=en"><button aria-pressed="false" class="trigger focusable visually-hidden" type="button">Open Shortcuts configuration options</button><ul class="contextual-links" hidden=""><li class="block-configure"><a href="/admin/structure/block/manage/shortcuts?destination=node">Configure block</a></li><li class="entityviewedit-form"><a href="/admin/structure/views/view/shortcuts/edit/shortcut_block?destination=node">Edit view</a></li></ul></div>
      <div class="content">
      <div><div class="contextual-region view view-shortcuts view-id-shortcuts view-display-id-shortcut_block js-view-dom-id-cf669f0007ee755b6d637bbcefe3cd19c0a456a3e34d2836f3e43976f31c8431">
  
    <div role="form" class="contextual" data-contextual-id="entity.view.edit_form:view=shortcuts:location=block&amp;name=shortcuts&amp;display_id=shortcut_block&amp;langcode=en"><button style="display: block;" aria-pressed="false" class="trigger focusable visually-hidden" type="button">Open  configuration options</button><ul class="contextual-links" hidden=""><li class="entityviewedit-form"><a href="/admin/structure/views/view/shortcuts/edit/shortcut_block?destination=node">Edit view</a></li></ul></div>
      
      <div class="view-content">
      <div class="item-list">
  
  <ul>

          <li><div class="views-field views-field-title"><span class="field-content"><a href="/node/add">Add content</a></span></div></li>
          <li><div class="views-field views-field-title"><span class="field-content"><a href="/admin/content">All content</a></span></div></li>
    
  </ul>

</div>

    </div>
  
          </div>
</div>

    </div>
  </div>
jibran’s picture

Status: Needs work » Needs review
StatusFileSize
new4.4 KB
new186.85 KB

Fixed the feedback from #53.

  1. Left it as is for now.
  2. Fixed.
  3. Fixed.
  4. Fixed.
  5. Fixed.
  6. Fixed.
  7. Yeah we don't want to store the redundant values form previous config and recreating will make sure of that.
  8. Fixed.
  9. I disagree, the purpose of this class is to add a block and now block is being replaced.
  10. Hmmm, let see what @Wim Leers thinks about it.
  11. Fixed.
  12. Added.

I'll try to write the upgrade path tests next.

Status: Needs review » Needs work

The last submitted patch, 56: convert_shortcut_block-2502151-56.patch, failed testing.

jibran’s picture

Status: Needs work » Needs review
StatusFileSize
new22.46 KB

Nice one.
Now with git diff 8.1.x > convert_shortcut_block-2502151-58.patch instead of git diff 8.0.x > convert_shortcut_block-2502151-56.patch

Status: Needs review » Needs work

The last submitted patch, 58: convert_shortcut_block-2502151-58.patch, failed testing.

jibran’s picture

Status: Needs work » Needs review
Issue tags: -beta target, -Needs upgrade path tests
StatusFileSize
new4.52 KB
new26.98 KB

With upgrade path tests now.

Status: Needs review » Needs work

The last submitted patch, 60: convert_shortcut_block-2502151-60.patch, failed testing.

jibran’s picture

This test passes locally for me.

jibran’s picture

Status: Needs work » Needs review
StatusFileSize
new515 bytes
new26.91 KB

Maybe this will fix this.

Status: Needs review » Needs work

The last submitted patch, 63: convert_shortcut_block-2502151-63.patch, failed testing.

kattekrab’s picture

nice to see this moving again Jibran! :)

The last submitted patch, 63: convert_shortcut_block-2502151-63.patch, failed testing.

jibran’s picture

Status: Needs work » Needs review
StatusFileSize
new886 bytes
new26.91 KB

With green patch. Maybe the fails will be more verbose after #2608532: Simpletest UI munges PHPUnit-based test output.

Thanks @kattekrab.

tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community

Looks great to me. Thanks a lot @jibran, really great work!

tstoeckler’s picture

I still think it is unnecessary to remove the block class, as there is no real benefit to breaking BC for that, but I'll let committers decide that. It's not a big issue to remove that part from the patch.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/shortcut/shortcut.install
@@ -67,3 +70,51 @@ function shortcut_uninstall() {
+  $module_handler = \Drupal::moduleHandler();
+  // Skip the update if Views and Block module are not installed.
+  if (!$module_handler->moduleExists('views') || !$module_handler->moduleExists('block')) {
+    return;
+  }

+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\shortcut\Plugin\Block\ShortcutsBlock.
- */

So if a site is using shortcuts but not views then they'll just lose the block? Also what happens if they've placed the block - I think that now the block would be broken...

alexpott’s picture

I think we'll either need to maintain the shortcut block as a fallback - but that is going to be very confusing since not sure how a fallback with blocks would actually work. I think we should just proceed with the shortcut views integration that this patch adds.

jibran’s picture

Here is what I think we should do:

  • Remove the upgrade path and upgrade path tests.
  • Keep the old class ShortcutsBlock.
  • Keep the disabled view as default config.
alexpott’s picture

So I think it makes sense to not "upgrade" the shortcut block but provide views integration. I'm not sure of the point of providing the disabled default view? Also all the block creatiion trait stuff should be in a separate patch.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

sivakarthik229’s picture

StatusFileSize
new11.59 KB

Hello,

Adding patch for Drupal 9.4.
Please review and provide the feedback.

Thanks
Siva

sivakarthik229’s picture

Status: Needs work » Needs review
sivakarthik229’s picture

StatusFileSize
new11.6 KB

Fixing PHPCS for the files.

sivakarthik229’s picture

StatusFileSize
new11.59 KB

Fixing PHPCS error.

Status: Needs review » Needs work

The last submitted patch, 90: shortcut-view-updated1.patch, failed testing. View results

quietone’s picture

Issue tags: -D8 upgrade path

It was suggested in #72 to remove the upgrade path. That was agreed to by alexpott in the next comment so I am removing the upgrade tag,

sivakarthik229’s picture

Hello,

Created shortcuts view module.
https://www.drupal.org/project/shortcut_view

Thanks
Siva

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Issue summary: View changes
quietone’s picture

Title: Convert shortcut block to view » Add a shortcut block view
Issue summary: View changes

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

quietone’s picture

Status: Needs work » Postponed

The Shortcut Module was approved for removal in #3476880: [Policy] Move Shortcut module to contrib.

This is Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.

The deprecation work is in #3569117: [meta] Tasks to deprecate the Shortcut module and the removal work in #3569121: [meta] Tasks to remove the Shortcut module.

Shortcut will be moved to a contributed project before Drupal 12.0.0 is released.