Comments

almaudoh’s picture

Issue tags: +hook_element_info
almaudoh’s picture

StatusFileSize
new9.7 KB

Here goes...

almaudoh’s picture

Status: Active » Needs review

Testbot.

Status: Needs review » Needs work

The last submitted patch, 2: convert-2325477-2.patch, failed testing.

almaudoh’s picture

Status: Needs work » Needs review
StatusFileSize
new9.71 KB

Status: Needs review » Needs work

The last submitted patch, 5: convert-2325477-5.patch, failed testing.

Status: Needs work » Needs review

almaudoh queued 5: convert-2325477-5.patch for re-testing.

Status: Needs review » Needs work

The last submitted patch, 5: convert-2325477-5.patch, failed testing.

tim.plunkett’s picture

  1. +++ b/core/modules/contextual/src/Element/ContextualLinks.php
    @@ -0,0 +1,108 @@
    +class ContextualLinks extends FormElement {
    +  /**
    ...
    +  }
    +}
    
    +++ b/core/modules/contextual/src/Element/ContextualLinksPlaceholder.php
    @@ -0,0 +1,52 @@
    +class ContextualLinksPlaceholder extends FormElement {
    +  /**
    ...
    +  }
    +}
    

    Please include a blank line at the beginning and end of the class

  2. +++ b/core/modules/contextual/src/Element/ContextualLinks.php
    @@ -0,0 +1,108 @@
    +   * @param $element
    ...
    +   * @return
    
    +++ b/core/modules/contextual/src/Element/ContextualLinksPlaceholder.php
    @@ -0,0 +1,52 @@
    +   * @param $element
    ...
    +   * @return
    

    These should be typehinted with array

  3. +++ b/core/modules/contextual/src/Element/ContextualLinksPlaceholder.php
    @@ -0,0 +1,52 @@
    +   * @see contextual_element_info()
    

    You just removed this, don't @see it :)

almaudoh’s picture

Status: Needs work » Needs review
StatusFileSize
new9.72 KB
new2.63 KB

#9: 1, 2, 3 fixed. Should contextual links and link placeholders be render elements instead of form elements?

Status: Needs review » Needs work

The last submitted patch, 10: convert-2325477-10.patch, failed testing.

tim.plunkett’s picture

Ah, I didn't notice that. Yes, if they don't have #input => TRUE, they are RenderElements.

almaudoh’s picture

Status: Needs work » Needs review
StatusFileSize
new9.73 KB
new1.39 KB

Updated patch to subclass RenderElement.

tim.plunkett’s picture

+++ b/core/modules/contextual/src/Element/ContextualLinks.php
@@ -7,14 +7,14 @@
  * @FormElement("contextual_links")

+++ b/core/modules/contextual/src/Element/ContextualLinksPlaceholder.php
@@ -8,14 +8,14 @@
  * @FormElement("contextual_links_placeholder")

Please also change the annotation. Thanks!

almaudoh’s picture

StatusFileSize
new9.73 KB
new1.48 KB

Oops! :) Fixed.

Interdiff is against #10.

The last submitted patch, 13: convert-2325477-13.patch, failed testing.

tim.plunkett’s picture

Excellent work @almaudoh! If this weren't horribly blocked by #2326409: Annotate render element plugins, it'd be RTBC.

Status: Needs review » Needs work

The last submitted patch, 15: convert-2325477-15.patch, failed testing.

almaudoh’s picture

Thanks @tim.plunkett. Sorry I've been AFK for a couple of days. I'll see how I can help over at #2326409: Annotate render element plugins and #2327965: drupal_flush_all_caches() doesn't clear all plugin caches. I'd be happy to discuss on IRC from wednesday (or on the issue queue from today) on what to do.

almaudoh’s picture

Status: Needs work » Needs review
StatusFileSize
new10.3 KB

Rerolled #15 and added patch from #2327965-1: drupal_flush_all_caches() doesn't clear all plugin caches to confirm that the tests will pass. No interdiff since there's no change.

Status: Needs review » Needs work

The last submitted patch, 20: convert-2325477-20_plus_2327965-1.patch, failed testing.

tim.plunkett’s picture

Status: Needs work » Needs review
StatusFileSize
new9.8 KB

Rerolled for now without the hook_element_info() removal in light of #2326409: Annotate render element plugins

Status: Needs review » Needs work

The last submitted patch, 22: 2325477-contextual-22.patch, failed testing.

tim.plunkett’s picture

Status: Needs work » Needs review
StatusFileSize
new9.93 KB
new1.16 KB
jibran’s picture

Status: Needs review » Needs work

NW for #2.

  1. +++ b/core/modules/contextual/src/Element/ContextualLinks.php
    @@ -0,0 +1,111 @@
    + * @todo Annotate once https://www.drupal.org/node/2326409 is in.
    

    I'd love to see this issue get fixed.

  2. +++ b/core/modules/contextual/src/Element/ContextualLinks.php
    @@ -0,0 +1,111 @@
    +    return \Drupal::service('plugin.manager.menu.contextual_link');
    

    I thought we can inject these but @tim.plunkett gave some valid points in irc and I think it needs little more discussion. So NW for this sorry.

  3. +++ b/core/modules/contextual/src/Element/ContextualLinksPlaceholder.php
    @@ -0,0 +1,54 @@
    +   * Renders an empty (hence invisible) placeholder div with a data-attribute that
    +   * contains an identifier ("contextual id"), which allows the JavaScript of the
    

    More then 80 chars.

tim.plunkett’s picture

Status: Needs work » Needs review
StatusFileSize
new10.15 KB
new2.71 KB
jibran’s picture

Status: Needs review » Reviewed & tested by the community

Thank you @tim.plunkett for fixing the issues.

+++ b/core/modules/contextual/src/Element/ContextualLinks.php
@@ -0,0 +1,120 @@
+      $class = drupal_html_class($class);

We can use Html::getClass($class); here.

Other then this we this is done so RTBC.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

  • webchick committed a3f0d47 on 8.0.x
    Issue #2325477 by tim.plunkett, almaudoh: Convert...

Status: Fixed » Closed (fixed)

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