ryancramerdesign / ProcessWire-2.0

THIS IS AN OLD VERSION. Get the new one at the URL below:
https://github.com/ryancramerdesign/ProcessWire
GNU General Public License v2.0
39 stars 5 forks source link

empty() and isset() not working on $page properties #3

Closed adamkiss closed 13 years ago

adamkiss commented 13 years ago

When calling i.e. empty($page->urlSegment) when urlSegment is in fact set, PHP returns incorrectly true.

This is probably because __isset() method wasn't implemented on $page object.

More information:

ryancramerdesign commented 13 years ago

__isset overloading isn't currently implemented in ProcessWire. I can see how it might cause confusion when doing something like empty($page->urlSegment), so I will go ahead and implement it it one of the next commits.

adamkiss commented 13 years ago

I know it isn't, I saw the code :)

But I think it might cause a lot of confusion (it took 45 minutes of my life already to find out why it isn't working and to find a solution :)

ryancramerdesign commented 13 years ago

This has been fixed in the current version. Can you confirm that it works for you?

ryancramerdesign commented 13 years ago

Closing since this has been fixed, but please let me know if you find anything similar.