Hi with domains with non standard port I get a path like this '/drupal/admin/domain/content/au.qtp:8080'
When switching between affiliate content pages I get this error message consitently
warning: parse_url(/drupal/admin/domain/content/au.qtp:8080) [function.parse-url]: Unable to parse URL in C:\www\drupal\sites\all\modules\domain\domain.module on line 1066.
If I click on the same page again the path is properly encoded ie. '/drupal/admin/domain/content/au.qtp%3A8080' and the error message disappear.
The problem here is with the colon, without it parse_url can parse succesfully. So should we just strip the colon or calling urlencode() just before calling parse_url()?
With the later however, it's going to be a problem for a feature that I'd like to have (#336218: Return to referring page after deleting content from affiliated content page). The problem is with drupal_goto(), it uses the following to get the return path parse_url(urldecode($_REQUEST['destination'])). It decodes the path first, so path 'admin/domain/content/au.qtp:8080' will get parsed like this
Array
(
[host] => admin
[port] => 8080
[path] => /domain/content/au.qtp:8080
)
So the colon really confuse the parse_url().
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | 336221-domain-content.patch | 1.98 KB | agentrickard |
| #15 | D5 port | 1.74 KB | ariflukito |
| #7 | domain.patch | 3.69 KB | ariflukito |
Comments
Comment #1
agentrickardThe problem is in line 44 of domain_content.module.
Does this work:
Comment #2
ariflukito commentedNo it doesn't. It makes all affiliate content pages disappear. There is only "Content for all affiliate sites" under "Affiliated Content".
Comment #3
agentrickardDid you rebuild the menus?
Comment #4
agentrickardThis may be insurmountable without using domain_id instead of subdomain as the url argument. I think the menu system is choking on the % sign that urlencode() inserts.
I originally wrote it that way to be more user 'friendly' to non-technical editors. The fix is to use domain_id instead.
There is a better solution by using %domain, and changing the arguments for domain_content_view().
Comment #5
ariflukito commentedYes I did rebuilt the menu.
The other option is to chop the port number all together and it still makes the url friendly. But I guess you don't want that, you want to keep them separate sites.
Comment #6
agentrickardYes. The fix in #4 is the proper one.
Comment #7
ariflukito commentedok something like this
some notes:
- using wildcard doesn't genarate menu items
- I pass the first page argument for domain/content/all as string ('-1'), because drupal doesn't seem to let me pass numeric value there
this one also works
edit:
hmm I think I made a mistake. I think the is_numeric() check inside domain_load() should be done in domain_lookup() instead, since the is_null() check is done there.
Comment #8
agentrickardGood point about menu items. Looks like we may still need to run a proper loop there, setting domain_id.
Does the current patch generate menu items as expected on the main Affiliated Content page?
Comment #9
ariflukito commentednope it doesn't generate menu items
Comment #10
agentrickardComment #11
agentrickardFixed. And we now run a menu rebuild when domains are updated.
Comment #12
ariflukito commentedI dont get the same warning in D5
should we force menu_rebuild() for next release?
Comment #13
agentrickardI was planning to force the menu rebuild. There are a handful of reasons for why it needs to be done. Not sure if this issue affects D5 in the same way.
Comment #14
ariflukito commentedoops I spoke too soon, I just get the same warning in D5.
Comment #15
ariflukito commentedbackport patch for D5
Comment #16
agentrickardComment #17
agentrickardUpdated to 5.x-dev and committed!