Support from Acquia helps fund testing for Drupal Acquia logo

Comments

amarphule created an issue. See original summary.

rahul.shinde’s picture

rahul.shinde’s picture

Issue tags: +#d8port
amarphule’s picture

Assigned: amarphule » Unassigned
Category: Feature request » Task
Status: Active » Needs review
Parent issue: » #3012400: [hypothesis] Hypothesis
FileSize
6.64 KB

Replaced the hook_page_build() with hook_page_attachments. See the CR https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21...

rahul.shinde’s picture

Status: Needs review » Needs work

Review of #8.

  1. +++ b/hypothesis.module
    @@ -2,80 +2,73 @@
    +  foreach ($default_behaviors as $key => $default_behavior) {
    

    Remove this. As we have defined config for this which has the default values I believe, so no need to re-iterate.

  2. +++ b/hypothesis.module
    @@ -2,80 +2,73 @@
    +  $attachments['#attached']['drupalSettings']['hypothesis'] = $default_behaviors;
    

    Replace $default_behaviors with $config->get('behavior');
    And remove this $default_behaviors = $config->get('behavior');

amarphule’s picture

Status: Needs work » Needs review
FileSize
6.44 KB
1.01 KB

Updated .module file as suggested in comment #9. And added interdiff.

rahul.shinde’s picture

@amarphule, please have config schema changes here as those changes are apt and should go with this ticket. Here is the comment issues-3048147#comment-13077908

rahul.shinde’s picture

Status: Needs review » Needs work
amarphule’s picture

Status: Needs work » Needs review
FileSize
8.5 KB

updated hook_page_attachments(). updated config schema. added dependencies in libraries.yml.
Changed Unicode::* methods to mb_* functions as per https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Component%21Util...

rahul.shinde’s picture

Status: Needs review » Fixed

Patch merged to 8.x-1.x branch. @amarphule thanks.

Status: Fixed » Closed (fixed)

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