Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ParisLiakos’s picture

Status: Needs review » Needs work
Issue tags: -@depreacted +@deprecated
er.pushpinderrana’s picture

Assigned: joshi.rohit100 » Unassigned
Status: Needs work » Needs review
FileSize
2.86 KB
1.7 KB

Merged! Please review attached patch.

ParisLiakos’s picture

Issue tags: +Needs change record

Patch looks good, but i realized there is no change record for that yet

penyaskito’s picture

Status: Needs review » Needs work

Needs work per #3.

dawehner’s picture

+++ b/core/includes/common.inc
@@ -1735,7 +1735,6 @@ function _drupal_add_js($data = NULL, $options = NULL) {
-          // The function path_is_admin() is not available on update.php pages.
           if (!(defined('MAINTENANCE_MODE'))) {
             $current_path_is_admin = \Drupal::service('router.admin_context')->isAdminRoute();
           }

Well, technically it is available now, it should just return FALSE

joshi.rohit100’s picture

please review now.

dawehner’s picture

+++ b/core/includes/common.inc
@@ -1744,9 +1744,8 @@ function _drupal_add_js($data = NULL, $options = NULL) {
-            $current_path_is_admin = \Drupal::service('router.admin_context')->isAdminRoute();
+            $current_path_is_admin = FALSE;

Oh, well I meant that we should just call the method.

tim.plunkett’s picture

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

yeah

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

Still need a CR

ianthomas_uk’s picture

Status: Needs work » Needs review
Issue tags: -Needs change record
dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Yeah I do like this, ... made the code a bit more verbose/concrete.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 8: 2300817-path_is_admin-8.patch, failed testing.

ianthomas_uk’s picture

It's good to show where to get $route from, but as someone who hasn't had much to do with D8 routing I don't really understand the routeMatch line. Is that just getting the route for the current request? If so, why not just leave out the $route parameter? What is the equivalent of passing an arbitrary $path string?

ianthomas_uk’s picture

Status: Needs work » Needs review
FileSize
3.1 KB

reroll

LinL’s picture

Status: Needs review » Reviewed & tested by the community

Patch still applies, CR is done, and there are no other occurrences of path_is_admin() with the patch applied. RTBC.

Wim Leers’s picture

+++ b/core/includes/common.inc
@@ -1475,11 +1475,7 @@ function _drupal_add_js($data = NULL, $options = NULL) {
-          $current_path_is_admin = FALSE;
-          // The function path_is_admin() is not available on update.php pages.
-          if (!(defined('MAINTENANCE_MODE'))) {
-            $current_path_is_admin = \Drupal::service('router.admin_context')->isAdminRoute();
-          }
+          $current_path_is_admin = \Drupal::service('router.admin_context')->isAdminRoute();

So much nicer! :)

LinL’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
3.24 KB

Ooh, no longer applies now that #2362227: Replace all instances of current_path() has landed. Rerolled.

rpayanm’s picture

Status: Needs review » Reviewed & tested by the community

RBTC again.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Searching change records for "path_is_admin" returns the change record in the results, so we look good to go there. I wasn't able to find any other instances after applying the patch. This type of change is explicitly allowed, per https://www.drupal.org/contribute/core/beta-changes.

Committed and pushed to 8.0.x. Thanks!

  • webchick committed a30b30b on 8.0.x
    Issue #2300817 by joshi.rohit100, er.pushpinderrana, tim.plunkett,...

Status: Fixed » Closed (fixed)

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