I created a page with the alias "media" and then on every node (with content type "Gallery"), when the "Add media" link is clicked, the page with the alias "media" is loaded in the dialogue box instead of the dialogue box.

So, apparently, the page alias "media" is unavailable when the Media module is enabled? Otherwise, you get this bug/error.

CommentFileSizeAuthor
#10 1535940-set-browser-admin-path.patch630 bytesDave Reid
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

HyperGlide’s picture

Status: Active » Postponed (maintainer needs more info)

@carsonw -- Having a bit off difficulty understanding your problem. Can you please post a few screen shots or explain more.

Thanks!

carsonw’s picture

@HyperGlide -- Create a page and give it the path alias: media

Then, view a node of content type Gallery and click "add media"

HyperGlide’s picture

@carsonw -- Understand the alias.

Questions:

  1. Gallery is your custom content type -- correct?
  2. You added a file field or within a WYSWYG editor?

I am trying to reproduce your error but ask if you can submit more details please.

Thank you

Dave Reid’s picture

Version: 7.x-1.0 » 7.x-2.x-dev
Priority: Critical » Major
Status: Postponed (maintainer needs more info) » Active

Hrm, I'm able to reproduce this problem on both 7.x-2.x and 7.x-1.x. Very interesting.

Dave Reid’s picture

Issue tags: +needs backport to 1.x
Dave Reid’s picture

Issue tags: +sprint
Devin Carlson’s picture

Status: Active » Postponed (maintainer needs more info)

I've been trying to duplicate this but I'm not having any success.

Steps:

  • Fresh install of Media, WYSIWYG and all dependencies
  • Configure WYSIWYG to use CKEditor for all input formats
  • Add a new node of type "page", give it the title "Media" and the URL alias "media"
  • Add another new node of type "page" with the title "Test"
  • While adding the "Test" node, click on the "add media" button inside of the WYSIWYG editor
  • Media browser popup loads as expected

I've also tried this using an installation profile with ~60 modules installed including pathauto and it also worked as expected.

Dave Reid’s picture

Ok I think the key here is that I had the Subpathauto module enabled. I think we can help avoid this a little bit by implementing hook_admin_paths() for the media browser if the theme is set to the admin theme.

Dave Reid’s picture

Title: Conflict with page alias of "media" » Conflict with page alias of "media" when using the Subpathauto module
Assigned: Unassigned » Dave Reid
Priority: Major » Normal
Issue tags: -sprint
Dave Reid’s picture

Status: Postponed (maintainer needs more info) » Needs review
FileSize
630 bytes

This fixes the conflict for me and is probably a good thing to have defined.

Dave Reid’s picture

Status: Needs review » Fixed

Tested and confirmed, so committed #10 to both branches.
http://drupalcode.org/project/media.git/commit/cc55948 (7.x-2.x)
http://drupalcode.org/project/media.git/commit/6ed5881 (7.x-1.x)

g10’s picture

Status: Fixed » Needs work

similar issue:
site has 'media' path alias, with 'media/%' used as filter for the embedded view on 'media' page
the popup window loads the 'media' page instead of the media browser

unfortunately patch above does not solve the issue
(using subpathauto, admin theme, overlay…)

would a better option be to change all 'media/*' paths to 'admin/media/*' ?
(as it is now it kinda hijacks the root level)

Dave Reid’s picture

Status: Needs work » Fixed

@g10: Please test using Media 7.x-2.x-dev or 7.x-1.x-dev. This should be resolved now.

g10’s picture

Tested using Media 7.x-2.0-unstable6+1-dev and Sub-pathauto 7.x-1.2

settings at admin/config/search/path/subpaths :
the only option that works is when 'max depth' is disabled ('skip admin paths…' toggle doesn't have any effect)
but basically this also disables the Sub-pathauto functionality

Dave Reid’s picture

Oh, so the original issue here was simply having a node with alias 'media' but you've got a View with an argument. Yeah, that's totally going to take over any request for 'media/browser' and I'm not sure how we can support that.

g10’s picture

To be sure I disabled the view (+ Extended Path Aliases + Pathauto persistent state modules), and cleared the caches… the view is embedded in a node with view reference. So even w/o the view the issue was present.
The browser only showed up when the 'max depth' of Sub-pathauto was set to 'disabled'

Status: Fixed » Closed (fixed)

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

creando sensaciones’s picture

Version: 7.x-2.x-dev » 7.x-1.3
Component: Media Browser » Media field
Status: Closed (fixed) » Active

I have the same problem using the panels module.
I can create a panels page /media, but I can't pass an argument to it in the form /media/!term. That produces an 'page not found' error.
With /media-x/!term everything works fine.

pitxels’s picture

Component: Media field » Code
Issue summary: View changes

This is my second installation, finally I found that Media module fails upload files only when I enable pathauto.

  • Dave Reid committed cc55948 on 7.x-3.x
    Issue #1535940: Fixed media browser fails to load if Subpathauto is...
joseph.olstad’s picture

Status: Active » Fixed

@Dave Reid fixed this in "July 7, 2012 11:32" . see commit message

Status: Fixed » Closed (fixed)

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