Recent Topics

1 Dec 13, 2008 13:24    

My b2evolution Version: 2.x

Hi,

Over the (Saudi) weekend, I upgraded my blog from v1.10 to 2.4.5 --> www.izdihar.com and have been spending some time adapting the vastitude skin to suit my needs.

In doing that, I've noticed that I can't add new categories or amend existing ones. Each time, I get the message "The url name is invalid" when I click on update.

In the back office, I can see categories with the the URL names c1, c2, c3, c4, c11, c12 & c13. A check in the evo_categories table in MySQL confirms that these are the only records.

I did a search in here, but didn't identify a post that seemed directly related to this problem - maybe my search criteria were a bit off.

Can anyone suggest a fix for me?

2 Dec 13, 2008 16:31

OK, a bit more information on this one. I tried creating a new category directly into MySQL with the following results:

Firstly, an error message suggesting much as I get inside the blog

http://farm4.static.flickr.com/3234/3104153397_9924577e03_o.jpg

Then when I look at the table records, I see this

http://farm4.static.flickr.com/3109/3104156039_d3888cd09c_o.jpg

So despite the message, it has actually created the record. Progress of a sort, but nothing seems to have changed in the back office. The new category is though showing up inside the blog.

3 Dec 13, 2008 16:33

I had the same question. And I solved it changed the url name to somethig with any spaces inside, and trying not to repeat any categorie name I had before.
An example: I have a blog called "sponfut" and want to create a new category called "more stuff". So I will use in the URL name something like this: morestuffsponfut (no space and with the blog name inside)
I am sure why it is OK, but...

4 Dec 13, 2008 17:06

I'd understand that if I was using duplicate url names or if the ones I was using had spaces, but I'm not doing either. It remains a mystery...

5 Dec 14, 2008 13:54

Sorry to bother you guys, but can anyone offer me a way forward on this? I'd rather not be hacking into MySQL each time I need to add a category.

7 Dec 14, 2008 14:55

Thanks ¥åßßå,

So near yet not quite. Did the change 'UNIQUE' to 'INDEX' change on the cat_urllname in MySQL. Within MySQL now, I can add a new category without getting the error message shown above. OK, so we have made some progress.

Try the same thing though though the b2evo back office and I'm getting the same "The url name is invalid" message when using (in this instance) 'c15' as the url name. I then tried just entering '15' as the url name and it worked.

Looking at the db structure, I can't see why an integer would work, yet a character wouldn't, when the type set for cat_urlname is varchar(255) :-/

Just tried creating a category called TEST3 using test3 as the cat_urlname and that works too. Stranger and stranger...

I'd love to know what's going on, but it doesn't seem to like the letter 'c' - this would never happen on Sesame Street

8 Dec 14, 2008 15:21

It's caused by the second regex in this section of code ( inc/chapters/model/_chapter.class.php approx 92 )

		// Check url name
		if( param_string_not_empty( 'cat_urlname', T_('Please enter an urlname.') ) )
		{
			$this->set_from_Request( 'urlname' );
			if( ! preg_match( '|^[A-Za-z0-9\-]+$|', $this->urlname )
					|| preg_match( '|^[A-Za-z][0-9]*$|', $this->urlname ) ) // This is to prevent conflict with things such as week number
			{
				param_error( 'cat_urlname', T_('The url name is invalid.') );
			}

Basically you're unable to have any single letter followed by just digits ( try z100 ) ... tad flawed since it uses c## by default :p

¥

9 Dec 14, 2008 15:27

I'm sure someone had a good reason for this, but I must admit it's evading me at the moment. I guess so long as I know, I can work around it. Would have been useful to put that warning into the screen you can create a category from though. Thanks for the help.

10 Dec 14, 2008 17:56

I'm damn sure they did :D

If I remember I'll change the installer/upgrader and add a message to the categories screen/error to clarify things ;)

¥


Form is loading...