Something's wrong with StaticPage...

Creating and modifying plugins.
Post Reply
wesley
Regular
Posts: 197
Joined: Sun Jul 10, 2005 11:15 am
Contact:

Something's wrong with StaticPage...

Post by wesley »

Hmm, up to version 1.31 (CVS numbering) I could save changes to my
static pages properly, but on 1.33 I can't save them. After pressing 'save'
it seems to look like the changes were saved, but when I go edit another
static page and come back, none of the changes were actually saved.
Perhaps there was a bug introduced while whe childpage thing was getting
implemented.

Oh, and another thing... this is a bug that I notice even in 1.31...If I select
'No' to both 'Perform Markup Transformations' and 'Format as Article', the
settings seem to be saved, but when I come back for another edit, the
radio buttons for these not have them selected on 'No', but rather, it's not
selected at all. If I just save it once more at this point, it gets saved as
'Yes'. This is very annoying as I have to manually re-select 'No' every time
I edit the static page with those two options turned off.
I make s9y plugins, too.
My s9y blog depends on them. :)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Something's wrong with StaticPage...

Post by garvinhicking »

I have just committed a version which fixes some bugs left and has verbose error output.

I cannot reproduce your "No/Yes" problem though; everything works as expected here. Are you using postgreSQL?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
wesley
Regular
Posts: 197
Joined: Sun Jul 10, 2005 11:15 am
Contact:

Post by wesley »

The verbose error output has pinpointed the cause of the problem:
ERROR:
(contents of entry displayed)
/ Unknown column 'show_childpages' in 'field list'
The script wasn't able to write that field because it wasn't accessible.
So I took a look at the database and found that show_childpages did not
get added. Nor were pre_content or is_startpage.

Apparently, the database upgrading somehow didn't add those.
I manually set db_built variable to '3' so maybe it would add those tables,
but after a refresh it went to '5' without adding them. Hence any attempts
to save the static page would still result in that error, preventing the save.

So I had to manually run the ALTER TABLE queries via phpMyAdmin to
create them.

After that, the save works, and it says 'ERROR: 1'. I guess that's because
return value was 'true'.


Meanwhile... the Yes/No problem. It doesn't occur with just the two
settings, but with others Yes/No settings as well.

I use MySQL. The database seems to hold 0 and 1 for the boolean values
properly. However, the error above showed me that the 'false' value is
basically saved as ='' and 'true' as ='1'. Database has the 'false' vaule
saved as '0', but saving as 'no value' must be treated the same way.
However, when the database is queried to load the values fresh, maybe
it sees '0' as '', and interprets it as 'undefined' instead of 'false'.

The thing is, this problem only happens in Static Page plugin. The other
plugins have no problem loading Yes/No information in the configuration
page.
I make s9y plugins, too.
My s9y blog depends on them. :)
wesley
Regular
Posts: 197
Joined: Sun Jul 10, 2005 11:15 am
Contact:

Post by wesley »

Okay, I think I found a fix for the Yes/No problem.

In showing the form, I edited the radio button chooser to recognize value
of '0' as well, like so:

$hvalue === '' || $hvalue ==='0' || $hvalue === 'false'

and now it works without problems. I'm gonna have this change committed
right now.
I make s9y plugins, too.
My s9y blog depends on them. :)
Post Reply