Closed (fixed)
Project:
Pathauto
Version:
5.x-1.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Feb 2007 at 15:15 UTC
Updated:
21 Jan 2008 at 15:26 UTC
I'm running Drupal 5.1. I get this error with both pathauto 5.x-1.0 and 5.x-1.x-dev.
When first submitting the node, pathauto works fine. Upon editing a node, however, I get a series of errors:
* warning: preg_replace() [function.preg-replace]: Unknown modifier 'p' in /home/example.com/sites/all/modules/pathauto/pathauto.module on line 263.
* warning: preg_replace() [function.preg-replace]: Unknown modifier 'p' in /home/example.com/sites/all/modules/pathauto/pathauto.module on line 263.
* warning: preg_replace() [function.preg-replace]: Unknown modifier 'p' in /home/example.com/sites/all/modules/pathauto/pathauto.module on line 263.
* warning: preg_replace() [function.preg-replace]: Unknown modifier 'p' in /home/example.com/sites/all/modules/pathauto/pathauto.module on line 263.
* warning: preg_replace() [function.preg-replace]: Unknown modifier 'p' in /home/example.com/sites/all/modules/pathauto/pathauto.module on line 263.
* warning: preg_replace() [function.preg-replace]: Unknown modifier 'p' in /home/example.com/sites/all/modules/pathauto/pathauto.module on line 263.
* warning: preg_replace() [function.preg-replace]: Unknown modifier 'p' in /home/example.com/sites/all/modules/pathauto/pathauto.module on line 263.
* warning: preg_replace() [function.preg-replace]: Unknown modifier 'p' in /home/example.com/sites/all/modules/pathauto/pathauto.module on line 263.And the path for the updated node is incorrect. Instead of [yyyy]/[mm]/[dd]/[title], which the setting I'm using for this node type, the URL is set to [yyyy]/[mm]/[dd] and I get that series of errors.
If I reset Pathauto's settings to default, the errors go away. But if I make the two changes I prefer (BlogEntry to [yyyy]/[mm]/[dd]/[title] and Blog to [user]) then the errors resume.
Any help would be greatly appreciated.
Comments
Comment #1
gregglesThanks for this issue report.
It would be really helpful if you could test this out and see specifically which of those patterns is causing the problem (if it's just one, or a couple or...) and then add a "drupal_set_message(" with the value right before the preg_replace so that we know what is in the variable that is causing this problem.
by the way - I suggest using something to prefix the [user] entry like users/[user] or members/[user]. Otherwise a user with the username "admin" or "user" can sign up on the site and really cause problems.
Comment #2
gordyhulten commentedThank you - I get the errors if I make any changes to the default settings, whether it be to blogentry, user, create feed alias, etc. Whether I have one setting changed or all of them.
Is there something specific you'd like me to test for?
Comment #3
gregglesSo, every single pattern aside from defaults fails to work? That's awfully strange because there are certainly thousands of other sites using non default patterns and having problems.
You mentioned using [yyyy]/[mm]/[dd]/[title] and having problems and my question was if you also have problems using just [yyyy] or just [mm] or just [title].
I need to be able to reproduce the problem in order to debug and fix it. As it stands I can't reproduce it so I'm a bit stuck. So, I need you to communicate what it is about your settings and nodes that you are creating that make it cause this problem, but until then I'm sadly not able to fix anything.
Comment #4
SaxxIng commentedThe same problem occours to me!
Comment #5
SaxxIng commentedPerhaps I can give you some hints.
On a quite fresh drupal 5.1 installation (but not fresh at all) with nothing document, I try to create a simple "page" with title "testpage". Previously I configured in pathauto "[title]" for page type. So, when I try to post (for the first time) the new page, all works well except the url (that is node/1). When I edit the page and save again, I obtain the "famous warning" at error 263. If now i set in pathauto "page/[title]" and re-edit the page and save again, the warning message doesn't appear and the url is modified... but wrong! The obtained url is page (instead of page/testpage).
Is this useful for you?
Do you think is a bug or only some kind of configuration-corruption?
Thanks in advance for your help,
Saxx
Comment #6
SaxxIng commentedAlso, another hint:
If I set in pathauto "page/[nid]" the url is created well (page/9) but if I use "node path settings->Bulk update node paths" I always obtain the "waring on line 263" (but the result message is "Bulk update of nodes completed, one alias generated").
If I re-set pathauto to "page/[title]" I re-obtain "page" instead of "page/testpage".
Modules installed are:
- localizer 1.7
- cck 1.3 (but non used)
- category 1.1
- event HEAD
- Image 1.x.dev
- fckeditor
- gallery
- imce
- views 1.5 (but not used)
The strange thing is that I have a site almost identical (with the same modules) where all works well (pathauto included).
Thanks again,
Saxx
Comment #7
gregglesOk, it's interesting that this is now happening to two people, but I still can't make it happen.
Can you please state the title of the post that you are using? Perhaps it is related to certain characters.
Also, can you post some information about operating system and version of PHP?
Thanks.
Comment #8
SaxxIng commentedWell, changing the title produce no other results (always the same problem occour).
The site is hosted on a virtual server running on CentOS 4.2 (linux).
Php 4.3.9-3.15
MySQL 4.1.20
Perhaps I use the same host for another almost identical site and always works well on it.
Another hint: whenever I edit and save the page, the waring message appears repeated identical 9 time.
I hope this can be useful.
Many thanks,
Saxx
Comment #9
gregglesSaxxing - what is your answer to the question: "Can you please state the title of the post that you are using? "
Comment #10
SaxxIng commentedThe actual title is "testpage", but I can modify the title I any way and the result is the same.
I'm not sure this is what you want to know!
Can you explain me better what do you need to know? (state of the title)
Thanks a lot,
Saxx
Comment #11
gregglesNo - now that's a perfect explanation I was dubious that it would cause that problem, though.
Can you modify line 262 just before the preg_replace and add these two lines:
watchdog('pathauto_debug1','
');
watchdog('pathauto_debug2','
');
And then paste back the results that get added to your admin/logs/watchdog
Comment #12
SaxxIng commentedWell, if I add the two lines after the comment and before the "$ignore_re =...." the log is:
pathauto_debug1 23/02/2007 - 22:33
pathauto_debug2 23/02/2007 - 22:33 Thu
If I add the two lines after "$ignore_re =...." and before "$output = preg_replace(..." the log is:
pathauto_debug1 23/02/2007 - 22:37 \b
a\b|\ban\b|\bas\b|\bat\b|\bbefore\b|\bbut\b|\bby\b|\bfor\b|\bfrom\b|\bis\b|\bin\b|\binto\b|\blike\b|\bof\b|\boff\b|\bon\b|\bonto\b|\bper\b|\bsince\b|\bthan\b|\bthe\b|\bthis\b|\bthat\b|\bto\b|\bup\b|\bvia\b|\bwith
\b
pathauto_debug2 23/02/2007 - 22:37 Thu
Hope to be of help!
Thanks for your assistance,
Saxx
Comment #13
greggles@gordyhulten - can you provide similar answers to what Saxx has provided so that we can look for similarities?
Comment #14
SaxxIng commentedBad day... now the module doesn't work either in the other mine site.
The only thing I have made was to add a [categorypathfirst] in a field of pathatuto where before there was nothing (clear field). Now, when I edit or add a node of this type the module doesn't create the alias.
And (this is the very bad news) all modifies and new nodes of every other type (standard types or not) doesn't work more (i.e. all alias are created in the classical form node/xxx).
Any idea? Is some test I can do for you to help in discovering the cause of this kind of problem?
Many thanks for your help,
Saxx
Comment #15
gregglessaxx - I have a feeling that this is related to category module. Can you try to repeat this on a fresh site without categry module?
Comment #16
SaxxIng commentedYes, of course. I'll test it tomorrow on a fresh site without category module.
However in the first site I have made I use regolary pathauto and category with no problems. Something is happened in pathauto 5.x-1.x-dev (respect to pathauto 5.x-1.0) that has caused the problem (but only after I have modified a field in pauthauto config page). And this occour with all node types (standard and not).
Do you have some suggestions for the fresh installation I'll do tomorrow (a particular roadmap or list of modules)?
The last thing: on my previous post I told you that also my first site today presents the same problem I've described you yesterday! This is not really true! In fact the effect is the same (the automatic alias-generation doesn't work) but it differs in the outupt, because in the first site I don't obtain warnings! (everytime I add a node or modifiy and save an existent one the system encounter no errors or warnings! all works well! except that the url alias is always on the form of "node/xxx").
Thanks a lot,
Saxx
Comment #17
gregglesI don't have any ideas about what set of modules for the fresh install except for don't install category :)
There are several changes in 5.x-1.dev that might cause the problem though I don't know specifically what could cause the problem.
Comment #18
SaxxIng commentedWell, now I have a fresh Drupal 5.1 installation.
The only things I've installed are:
- my theme
- captcha (and textimage)
- feedback
- db_maintenance
What can of test do you want I do? And what version of pathauto should I install? (5.x-1.0 or 5.x-1.dev)
Many thanks,
Saxx
Comment #19
gregglesSaxx - now if you can install pathauto (5.x-1.dev version) and see if the same steps (e.g. altering the pattern and creating/editing nodes) causes the problem.
The ultimate goal in any bug report is to get to the smallest set of steps that will cause the problem to happen consistently.
Comment #20
SaxxIng commentedWell, I've installed pathauto 5.x-1.x-dev and used it on "page" and "story" nodes. It works well also after whenever I modify a field in pathauto (i.e. modify the rules to build the alias). Also the bulk update works well.
What do you suggest me to do now? Try to install category?
Many thanks,
Saxx
Comment #21
gregglesSaxx - yes, now the goal is to add more and more complexity (modules/settings) in tiny amounts and testing along the way until you are able to get the problem to repeat itself.
So, I'd say disabling all contrib modules and non-essential core modules except path and pathauto is the first step. Then install Category and test would be a good first step. If that doesn't cause the problem keep removing/adding a little more at a time until you find the exact smallest set that causes the problems.
Comment #22
SaxxIng commentedWell, I've made a lot of little modifies with pathauto+category (on settings and so on) on a fresh drupal 5.1 site, but it seems to always works well.
However perhaps I've found a clue. I've discovered that category modify the original taxonomy.module with a proper wrapper (it does this automatically) and also localizer needs a patch to taxonomy.module. I suspect that two "patches" conflicts somehow.
In your experiences, do you think it is possible?
If this is the cause, I make you my sincere apologies for the time you lost!
Many many thanks,
Saxx
Comment #23
gregglesWell I don't think we should rule out pathauto yet, but please keep testing and modifying getting more and more complex (e.g. install localizer and category together) so that we can see what combination of modules causes the problem.
It's the nature of complex software systems that the initially identified cause of the problem may not be the ultimate one. But when you do find it I think we should close this issue and create a new (and very simple) one :)
Comment #24
gordyhulten commentedI'm sorry I haven't followed up - I've been moving servers due to an unrelated issue, and halfway hoped that would fix my problem, but it hasn't.
First, I didn't have category module installed when I first experienced the problem.
Second, I have the problem regardless of the pattern I attempt to use. For example, for blog entries, I have the problem using both "user/[user]" and "[user']"
contrib modules I have installed are advpoll, akismet, archive, commentrss, fckeditor, livediscussions, pathauto, scheduler, service_links, systeminfo and votingapi.
Please let me know what else I might be able to do to try and isolate the problem - I really miss using pathauto.
Comment #25
Reso303 commentedI have exactly the same problem as above.
When I edit a content, that happens, and also when I do the bulk thing.
I found a way to avoid the problem when editing content, but when I want to bulk the bug comes out.
And I must make my "astuce" another time.
Ok, here's the tric, just go to your phpmyadmin and in the SQL panel, just paste this :
delete from variable where name like 'pathauto_%'
I found this piece of code in the files "pathauto.install" in the "modules/pathauto" directory
Hope this help.
Comment #26
gordyhulten commentedThis doesn't fix the problem for me - I still get the errors when editing posts, and pathauto creates the incorrect aliases.
Comment #27
gordyhulten commentedI did find some errors when trying to optimize my MySQL database in phpmyadmin:
drupal.url_alias optimize error Found 7228 keys of 0
drupal.url_alias optimize status Operation failed
Does that give you any clues?
I might try backing up my DB, clearing my drupal.url_alias table, and then trying to run pathauto to bulkupdate.
Thoughts?
Comment #28
gordyhulten commentedI tried emptying my url_alias table and re-running pathauto, but I still couldn't run pathauto without the errors.
Comment #29
Reso303 commentedIn fact when I delete the variable in the database, I've just edit the content and write manually each URL alias. I don't try to generate URL alias with pathauto, because I think it will crash another time. I'll try later.
This bug is really annoying.
Comment #30
Reso303 commentedOK to be more productive and helping found the problem, some info about my drupal configuration :
Drupal 5.1
installed modules : (listinf od my modules directory)
type=dir;modify=20070221160410;UNIX.mode=0755 adminblock <- active
type=dir;modify=20070209120829;UNIX.mode=0755 aggregator
type=dir;modify=20070209120833;UNIX.mode=0755 block <- active
type=dir;modify=20070209120836;UNIX.mode=0755 blog
type=dir;modify=20070209120840;UNIX.mode=0755 blogapi
type=dir;modify=20070209120846;UNIX.mode=0755 book
type=dir;modify=20070218180554;UNIX.mode=0755 category <- active
type=dir;modify=20070209123243;UNIX.mode=0755 cck <- active
type=dir;modify=20070209120857;UNIX.mode=0755 color <- active
type=dir;modify=20070209120901;UNIX.mode=0755 comment <- active
type=dir;modify=20070209123515;UNIX.mode=0755 computed_field <- active
type=dir;modify=20070209120905;UNIX.mode=0755 contact
type=dir;modify=20070209135639;UNIX.mode=0755 contemplate <- active
type=dir;modify=20070221154951;UNIX.mode=0755 db_maintenance
type=dir;modify=20070218182353;UNIX.mode=0755 dhtml_menu <- active
type=dir;modify=20070209120909;UNIX.mode=0755 drupal
type=dir;modify=20070227162921;UNIX.mode=0755 editview <- active
type=dir;modify=20070218183028;UNIX.mode=0755 email
type=dir;modify=20070304223446;UNIX.mode=0755 fckeditor <- active
type=dir;modify=20070209120912;UNIX.mode=0755 filter
type=dir;modify=20070209120917;UNIX.mode=0755 forum
type=dir;modify=20070212234855;UNIX.mode=0755 front
type=dir;modify=20070218183353;UNIX.mode=0755 greybox
type=dir;modify=20070209120921;UNIX.mode=0755 help <- active
type=dir;modify=20070217202120;UNIX.mode=0755 image <- active
type=dir;modify=20070225211223;UNIX.mode=0755 jrating <- active
type=dir;modify=20070209120924;UNIX.mode=0755 legacy
type=dir;modify=20070209120930;UNIX.mode=0755 locale <- active
type=dir;modify=20070209120933;UNIX.mode=0755 menu <- active
type=dir;modify=20070209120937;UNIX.mode=0755 node
type=dir;modify=20070218183846;UNIX.mode=0755 node_style <- active
type=dir;modify=20070227173752;UNIX.mode=0755 nodeasblock <- active
type=dir;modify=20070209140037;UNIX.mode=0755 nodewords <- active
type=dir;modify=20070212232829;UNIX.mode=0755 panels
type=dir;modify=20070209120941;UNIX.mode=0755 path <- active
type=dir;modify=20070304231405;UNIX.mode=0755 pathauto <- active
type=dir;modify=20070209120944;UNIX.mode=0755 ping
type=dir;modify=20070209120948;UNIX.mode=0755 poll <- active
type=dir;modify=20070209120951;UNIX.mode=0755 profile
type=dir;modify=20070209120955;UNIX.mode=0755 search
type=dir;modify=20070215223125;UNIX.mode=0755 sitemenu
type=dir;modify=20070226010118;UNIX.mode=0755 smfforum <- active
type=dir;modify=20070209120959;UNIX.mode=0755 statistics <- active
type=dir;modify=20070209121007;UNIX.mode=0755 system
type=dir;modify=20070218181417;UNIX.mode=0777 taxonomy <- active
type=dir;modify=20070209121014;UNIX.mode=0755 throttle
type=dir;modify=20070209121017;UNIX.mode=0755 tracker
type=dir;modify=20070209121020;UNIX.mode=0755 upload
type=dir;modify=20070209121024;UNIX.mode=0755 user
type=dir;modify=20070227202219;UNIX.mode=0755 viewfield <- active
type=dir;modify=20070213094737;UNIX.mode=0755 views <- active
type=dir;modify=20070221121619;UNIX.mode=0755 views_alpha_pager <- active
type=dir;modify=20070303142908;UNIX.mode=0755 views_bonus <- active
type=dir;modify=20070221123315;UNIX.mode=0755 views_fastsearch <- active
type=dir;modify=20070221123329;UNIX.mode=0755 views_filterblock <- active
type=dir;modify=20070225211357;UNIX.mode=0755 votingapi <- active
type=dir;modify=20070209121029;UNIX.mode=0755 watchdog
I know there's a lot... But I was like a child behind his new toy :P
For the category module, in fact, I've try it and can't cancel it, so it's still running because of the taxonomy patch...
I suspect that module is not very stable.
All that things runs on an online dedicated server under linux with PHP Version 4.4.2 and MySQL: 3.23.49
Voila :)
My next step for the pathauto problem is to reinstall drupal and the module and reinsert my actual content.
Comment #31
gordyhulten commentedJust to be clear, I'm having the problem but I don't use the category module.
Comment #32
Reso303 commentedIn addition to my precedent post.
The things I've done juste before the bugs appends.
I've just installed FCK Editor, turn off tinyMCE, reboot the server, done some modification in the localization module (language french).
And just before the bug, I've made a modification on the filter in the pathauto module.
I want to have a pattern like that : serie/[title].html
and boom bug when I've launch the bulk update.
Comment #33
gregglesHello - I'm still not able to reproduce this issue as you've stated it. Can you provide a very simple set of steps involving the fewest contributed modules necessary that will cause the problem?
Comment #34
Southpaw commentedFrom a quick look at the error and the code (which I also got). I believe this might have something to do with clearing everything from the 'strings to remove' and using one of the wysiwyg editors which then insert a
into the blank space.
It will start working again if (using FCKEditor) you click the 'code' button to view the HTML. Then just remove that line.
Not sure if TinyMCE does the same thing.
Removing the
line fixed my problem btw.
Comment #35
gregglesaha - that would make for an interesting reason for this issue. I don't use any of those edtors.
Since drupal filters the text it looks like you are saying that an "ampersand nbsp" is what causes the problem. Is that right?
For saxxing, gordyhulten, and Reso303 can you confirm this behavior?
Comment #36
gordyhulten commentedI disabled FCKeditor, re-installed pathauto, changed my default path settings, and then re-enabled FCK editor.
This has, indeed, corrected the problem.
Thank you so much for all of your assistance.
Comment #37
gregglesWell, I think we can call this closed. This is a major bummer that it was caused by the wysiwyg editors on admin pages. I guess for now we know one symptom of the problem.
Comment #38
Southpaw commented@greggles. It's the 'paragraph' 'amp nbsp ;' 'close paragraph' html tags that break it.
(Didn't notice that Drupal removed all the code after my post sorry bout that.
Comment #39
Roderick_E commentedOk I read everything here about this problem & understand it has something to due with how FCK editor adds stuff at the end. I tried uninstalling pathauto & disabling FCKeditor & reinstalling pathauto but I still get the same error when trying to create STORY, please help further -- sorry I'm dense on this.
Comment #40
gregglesSteps to resolve:
1. Disable any WYSIWYG editors
2. Visit admin/settings/pathauto
3. Clear out the "words to replace" box or at least make sure that you don't have
<p></p>tags around it.4. Save the settings
That should fix everything.
Comment #41
maxkar commentedMAKE SURE YOU DON NOT HAVE THE WYSIWYG EDITOR ON AS DEFAULT FOR THE ADMIN USER BECAUSE IT WILL PUT
TAG AROUND THE "Strings to Remove:" SECTION.
Comment #42
maaberge commentedThanks greggles. When I disabled the WISYWIG editor the p tags were present. I've removed them. Voila!
Maarten