Closed (fixed)
Project:
Extended Path Aliases
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
18 Mar 2014 at 14:45 UTC
Updated:
24 May 2019 at 18:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
rdeboerHi Richard,
The weight was changed to -1 because of similar problems when Extended Path Aliases is used with other modules.
Sounds like we have a catch 22....
To work with the Redirect module the weight of Extended Path Aliases needs to be greater than 0, for some other modules it needs to be less than 0....
Not sure what to do other than to comment it in the README?
Rik
Comment #2
rviner commentedHi Rik,
Ok thanks for the info. I don't see this as being a big problem so I'll take it by a case by case basis. I can't see that much can be done so a note in the README would be handy.
Richard
Comment #3
marcoka commentedthe module weight has to be changed in the database right?
Comment #4
rdeboerYes. The {system} table has a weight column. You need to change the value of the weight column for the row/cell corresponding to the module name.
Comment #5
dagomar commentedFor me changing the weight didn't change the faulty behaviour. So I came up with this in the function path_alias_xt_url_inbound_alter:
May not be the best solution, but it works for me. Should I make a patch? It took me almost a whole day to debug this!
Comment #6
dagomar commentedI decided to create a patch regardless. I'll leave it here in case someone needs it.
Comment #7
ivanstegic commentedWe've been struggling with this on a very high traffic site, and were able to get it to work appropriately by changing the weight. However, I actually agree with #5 and think this is a better way to solve the problem, since the weight should really be -1 as intended.
This patch goes a little further -- given that we are also affected by #1796596: Fix and prevent circular redirects and that patch makes a schema change to Redirect itself, I've added some schema version checking of Redirect. The ability to designate a redirect as active or not should be taken into account for schema versions starting with 7101.
It would be great to see the RTBC and into the module soon!
Comment #8
franzQuick note: should have a space after 'if'
Comment #9
bember commentedAdding a patch that combines #6 and #7.
Comment #10
franzPatch works fine.
Comment #11
bember commentedBest practices fix: moving code block to a better place.
Comment #12
El Bandito commentedI'm seeing an issue where a redirect from the path :
top/middle/tail ( which is node number 111111 )
is getting re-written to :
node/222222/tail
where node/222222 is the nid of of the node aliased as 'top/middle'.
The patch fixes existing redirects but when a new redirect to node/1111111 is created it receives the destination node/222222/tail which causes the browser to display node/222222.
Comment #13
mikhailkrainiuk commentedHello,
We have the same conflict with Redirect module for Drupal 8.
What if we will check the new path to exist?
For example:
- "top/middle/tail" will be redirected after current module
- we have "node/222" with the alias "top/middle"
New logic:
- the module generates a new candidate "node/222/tail"
- we check the path "node/222/tail" to exist
It does not exist. We don't change the path.
If we have "top/middle/edit", it will be changed to "node/222/edit" that exists. The module returns "node/222/edit".
Comment #14
mikhailkrainiuk commentedComment #15
kala4ekComment #16
kala4ekHere is patch for D8.
Comment #17
iancawthorne commentedJust wanted to add that I was getting the following error on all node instances (node/x, node/x/edit, node/x/anything etc both aliased and non aliased) when creating a view with a contextual filter of node id in this format "node/%/something", with extended path alias and also redirect module enabled.
Applying the patch at #16 has resolved this problem.
Looking back at this thread, I'm not sure it describes the same issue as I was having, but has certainly also resolved it, possibly indirectly.
Comment #18
nwom commented#16 works great and applied cleanly. Thank you!
Comment #20
adriancidThanks for this
Comment #21
adriancid