Thanks Nate.
I found the line in minisite_page.php3 and changed that.. (btw, I had
to escape the hyphen so "0-9a-z_\-")... Now I'm trying to figure out
how to change the validation script that runs that checks to see if
the user actually put correct information in the URL fragment input
box. As it currently stands the page will allow me to save it with the
hyphen in the url fragment but when I type the hyphen it adds the
class "rules inappropriate_url_warning". I found that class addition
in the /js/content_managers/page_parent_url.js file - but don't see
where it has a regex to test against.
- Kevin
On Apr 12, 5:24 pm, Nathan White <
n...@natewhite.com> wrote:
> Hi Kevin - the code that checks the URLs when you create pages is in the
> file reason_package/reason_4.0/lib/core/content_managers/minisite_page.php3
> in the method run_error_checks(). In my development version of Reason it is
> line 348:
>
> if( !preg_match( "|^[0-9a-z_]*$|i" , $this->get_value('url_fragment') ) )
>
> I think if you change that to this it will work:
>
> if( !preg_match( "|^[0-9a-z_-]*$|i" , $this->get_value('url_fragment') ) )
>
> I would probably see how many you have before you try to change them
> automatically. If it is just a handful, it probably is easiest to change
> them manually. That way, the URL History and RewriteRule updates are taken
> care of for you.
>
> Something like this should find them:
>
> $es = new entity_selector();
> $es->add_type(id_of('minisite_page'));
> $es->add_relation('page_node.url_fragment LIKE %-%');
> $result = $es->run_one();
>
> A script to automatically update them would want to do these things:
>
> 1. reason_update_entity to change the value of url_fragment to replace _
> with -
> 2. update_URL_history using the page entity id
> 3. create a url_manager object for each site where page urls changed and
> run rewrites
> 1. $um = new url_manager($site_id)
> 2. $um->update_rewrites();