Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293902

template_preprocess_links uses a non existent class JSON

$
0
0

This issue has novice tasks. If you are an experienced core developer and have multiple commit mentions, please review novices' work on these tasks rather than doing them yourself. Feedback from experienced contributors is valued.

Problem/Motivation

The following snippet is from template_preprocess_links()

          // Add a "data-drupal-link-query" attribute to let the
          // drupal.active-link library know the query in a standardized manner.
          if (!empty($link['query'])) {
            $query = $link['query'];
            ksort($query);
            $li_attributes['data-drupal-link-query'] = Json::encode($query);
          }

Proposed resolution

Missing a use statement for Drupal\Component\Utility\Json but as we are not getting a fail on testbot it appears we are also missing tests! The Drupal\system\Tests\Theme\FunctionsTest::linksTest() needs to be improved to catch this.

Remaining tasks

User interface changes

None.

API changes

None.


Viewing all articles
Browse latest Browse all 293902

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>