Urls change underscores to hyphen / dashes

Permalink
We've upgraded to 5.6.3.1. Our Urls use underscores ie: /resources/new_files/
but now when we save a page it changes the _ to a dash/hyphen /resources/new-files/ and this breaks our menus and links now. This did not happen in the older version of C5.

So to recreate. Go to a pages Properties -> Page Paths and Location and change the Canonical URL to have an underscore ie: new_files , hit save, go back and look at it. It will have changed to new-files

Is this a bug?

Bump... Anyone?

 
guymon replied on at Permalink Best Answer Reply
OK. Well I hacked a fix myself. The version 5.6.3.1 changed the urlify.php to have this line.

$text = str_replace ('_', ' ', $text); // treat underscores as spaces

which then two lines latter says

$text = preg_replace ('/[-\s]+/', '-', $text); // convert spaces to hyphens

Nice programming!

I commented out that line but it still did not fix it. Might be a caching issue. I just ended up changing the line in page.php at about 1189:

$cHandle = $txt->urlify($data['cHandle']);

to

$cHandle = $data['cHandle'];

Blah!

notes:
if it's an updated C5 the location would be
/updates/concrete5.6.3.1_updater/concrete/models/page.php
NRB replied on at Permalink Reply
NRB
Which page.php file? Where is it located?
NRB replied on at Permalink Reply
NRB
Hi. Did you find a solution to this?
guymon replied on at Permalink Reply
I updated my post with the location, if it's an updated version of 5.6.3.1.
NRB replied on at Permalink Reply
NRB
No luck finding it still.

I have "/concrete5.6.3.4/updates" folder but it's empty.

Also have a "/public_html_stage/updates/concrete5.6.3.3/concrete/models/page.php" file, but there's only three lines of code.
guymon replied on at Permalink Reply
It's whatever version you are using or if it's a new install it would just be in the /concrete/models/page.php
NRB replied on at Permalink Reply
NRB
Yes, I found the page.php file under "concrete/models/page.php" but it only has three lines of code - these:

<?php
defined('C5_EXECUTE') or die("Access Denied.");
class Page extends Concrete5_Model_Page {}