URL to Weblog creates erroneous behavior

This is the place to discuss bugs that have been found in the most recent version of PivotX. Posting bugs will ensure that the Development Team is aware of them and that they will be addressed when resources are available.

URL to Weblog creates erroneous behavior

Postby Schop » Mon Jul 25, 2011 3:58 pm

I think a bug was introduced goign from 2.2.5 to 2.2.6 (or maybe earlier, I'm not entirely sure).

If there is a value in the setting for 'URL to Weblog', the URL's are created wrong for entries and pages, and also in the rss feeds and such (see first screenshot):
wrong-urls.png
wrong-urls.png (5.18 KiB) Viewed 12463 times

Somehow the links in the frontend to the entry do work though...strange.

Of course, you don't see this if you leave the setting empty.

However, it seems that in 2.2.6, you're not allowed to do so anymore. If you ever put a value in the field, you can't delete it anymore, and it seems you can in 2.2.5:
url_to_weblog.jpg
url_to_weblog.jpg (110.3 KiB) Viewed 12463 times

In this screenshot, the value is gone, because I manually removed it from ser_weblogs.php, which is not recommended of course.

The fact that you were able to keep the field empty before, was only hiding the real bug, I think. Why would I not be able to enter the URL to my weblog here, and still keep the same URL's?
User avatar
Schop
Contributor
 
Posts: 485
Joined: Mon Apr 21, 2008 1:47 pm
Location: Hudson, Ohio

Re: URL to Weblog creates erroneous behavior

Postby hansfn » Mon Jul 25, 2011 5:53 pm

The URL should be a local path, not including domain (and protocol). In other words, "/my-first-weblog/", not "example.org/my-first-weblog/" or "http://example.org/my-first-weblog/". Leaving out the domain makes the setting portable.

I agree that there are two problems:
1) The tool tip doesn't say it should be a local path.
2) PivotX shouldn't allow the user to enter an URL with protocol (and probably also strip out the domain and protocol before saving).
hansfn
Developer
 
Posts: 3282
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: URL to Weblog creates erroneous behavior

Postby Schop » Mon Jul 25, 2011 6:59 pm

Agreed.

But in this case, I had the weblog in a subdomain at first, for which I needed the setting, if I'm not mistaken. Now the weblog has moved:

First it was at http://newweblog.example.com
Now I moved it to http://example.com

What values was I supposed to use? I'm thinking I don't need any value in there right now, but I was not allowed to remove it....
User avatar
Schop
Contributor
 
Posts: 485
Joined: Mon Apr 21, 2008 1:47 pm
Location: Hudson, Ohio

Re: URL to Weblog creates erroneous behavior

Postby hansfn » Mon Jul 25, 2011 7:38 pm

I had the weblog in a subdomain at first, for which I needed the setting, if I'm not mistaken.

I think you are mistaken - PivotX detects which URL (and hence domain) it's accessed from on the fly.

I'm thinking I don't need any value in there right now, but I was not allowed to remove it...

You are correct that you don't need any value. You can't remove it because of a bug in the form validator. You can fix it by editing forms.php. Look for "URL to Weblog" - very near you'll find the line

Code: Select all
'validation' => 'ifany|string|minlen=2|maxlen=80',

Replace it with

Code: Select all
'validation' => 'ifany|minlen=2|maxlen=80',
hansfn
Developer
 
Posts: 3282
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: URL to Weblog creates erroneous behavior

Postby Schop » Mon Jul 25, 2011 7:55 pm

Thanks Hans! I 've modified the code, and I am assuming it will be corrected in the next release.

This leaves me with one puzzling question: if PivotX detects the URL on the fly, why is this setting even there?

Anyway, I'm gald you're back, hope you had a nice vacation!
User avatar
Schop
Contributor
 
Posts: 485
Joined: Mon Apr 21, 2008 1:47 pm
Location: Hudson, Ohio

Re: URL to Weblog creates erroneous behavior

Postby hansfn » Mon Jul 25, 2011 8:05 pm

The setting is there so you can do stuff like http://book.pivotx.net/page/2-5-4
hansfn
Developer
 
Posts: 3282
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: URL to Weblog creates erroneous behavior

Postby Harm10 » Mon Jul 25, 2011 8:26 pm

hansfn wrote:You are correct that you don't need any value. You can't remove it because of a bug in the form validator.
By some chance I just fixed that problem in revision 3793 1 hour ago! I stumbled upon it when testing a new theme.
Quality is in the detail of things............

Want to change or update your PivotX site? Mail or PM me!
I can also convert your site to a Wordpress site!
Harm10
Developer
 
Posts: 2011
Joined: Wed Jun 17, 2009 9:37 am
Location: Somewhere in The Netherlands (aka Holland)


Return to 2.x Bugs

Who is online

Users browsing this forum: No registered users and 1 guest

cron