Jump to content

Recommended Posts

Posted

Good evening,

I think I may have found a bug in the current release (PW 2.2.5) - I tried to add a new page which is called "0/" (URL "/gallery/0/").

Problem is, I could not save the page - The following error appeared:

Error Call to a member function error() on a non-object (line 267 of ...\wire\modules\Process\ProcessPageAdd\ProcessPageAdd.module)

I havent looked into it, but taking a wilkd guess I'd say there's a check on an "empty" URL?

I created another page called "test" (URL "/gallery/test/") and edited it, after creation - It worked.

Posted

I can reproduce this and it's also clear that 0 (zero) is like false|null . So I think PW checks for if there's a page with that name and it fails.

Not sure about it, but why do you have to name it 0?

Posted

Not sure about it, but why do you have to name it 0?

It's the naming convention of a friend (artist) who I'm actually developing a portfolio/gallery site for.

I don't get it myself, but it's really important to him :/

Posted

I can reproduce this too. This is a bug, as it should allow a page named "0". Sn4ke I think you are right, that there is likely an empty() check somewhere there should be a !strlen() check. Unfortunately I can't seem to find where it is yet, so going to add this to the issues list until I've got more time to get deeper into it. Btw, the error message you got is actually something different, and I have fixed that. The actual error message is "Can't add because that page already exists."

Posted

The error is here: (from w/core/mod/Proc/PPA/ProcessPageAdd.module:265)

$this->parent->child("name=$name")->id

This code actually returns id of first child of 'parent', so I'd look either in query builder or for MySQL bug.

Edit: DEBUG Log from the query:

 array(4) {
   ["time"]=>
   string(21) "0.26071100 1347894072"
   ["action"]=>
   string(4) "find"
   ["details"]=>
   string(51) "parent_id=1007, name=0, limit=1, start=0, sort=sort"
   ["result"]=>
   string(4) "1008"
 }

Edit: tested query with mysql

select * from pages where name=0

returns all pages.

Posted

I think it's the way PW handles selector values, see my comment on the issue at GitHub (for some reason I thought it was better to comment there at first - could have said something here as well).

That field (pages.name) is a varchar(128) but whenever a page name that can be interpreted as an integer is given, the value in the SQL query is not quoted and thus not interpreted as a string as it should be when the field is declared as varchar.

This may get tricky so I didn't want to go any deeper myself - I'll let Ryan do his magic :).

  • 3 weeks later...
Posted

It also seems to have affected pages named "1" (maybe all pages with a number for name?). Seems to be working in the latest version.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...