POG 3 upgrade keeps wiping my database fields

23 views
Skip to first unread message

Andy Law

unread,
Jul 9, 2011, 1:28:40 PM7/9/11
to Php Object Generator
I've spent a frustrating few hours trying to upgrade a site that I run
from version 2.6.3 to 3.0. I got the nusoap redeclaration error when I
tried the "Upgrade" link (I've *never* got that to work properly), so
I ended up regenerating the files one-by-one via the @link url.

I replaced all the configuration and the base classes and all the
other shenanigans and loaded up all my newly generated class file.
Then I hit the setup scripts.

And then I found that all the date fields and several others had been
completely emptied.

I reloaded the database from the backup and tried again. Same result.

I've now backed out to the old 2.6.3 version and I'm sitting
scratching my head.

Anyone else seen this or - better - got a solution that I can use to
stop this happening?

Later,

Andy

LAW Andy

unread,
Jul 9, 2011, 4:42:05 PM7/9/11
to Joel Wan, Php Object Generator
Joel,

** B****r!! **

This is weird.

Now that I look more closely, I discover that the data is *not* being cleared immediately, if I "Bypass Unit Tests". Rather, the POG interface is failing to display the data. All fields are apparently intact, but not all fields are displayed. And, embarrassingly, it is not all the tables that are affected, just the *main* one in the system.

If I include the Unit Tests, then the values in some fields in the table are being set to default, empty values.

My current suspicions is one of the "enum" fields in the object/table, but given my poor track record at spotting the real problems in this scenario, I'm not sure.

The object has three enums. Some of them are working, but the last one is not (i.e. it is not being displayed with the correct values in the POG "manage objects" interface). None of the date and time fields after the third enum are being displayed either.

The values in the enum are nothing out of the ordinary (`fixturetype` enum('League', 'Cup', 'Friendly', 'Tournament', 'Training') NOT NULL,)

The object has 15 fields, including the Id field.

4 of them are being blanked (the enum, a date field and two time fields). These are fields 5-8 in the object.


I am deeply confused.

On 9 Jul 2011, at 20:58, Joel Wan wrote:

> Hi Andy,
>
> The fields that are being emptied, are they date-specific fields? What
> other fields clearing data?
>
> I suspect the db is dropping the data when the update statement is
> being called but I'm not sure why.
>
> Sent from my iPhone

>> --
>> You received this message because you are subscribed to the Google Groups "Php Object Generator" group.
>> To post to this group, send email to php-object...@googlegroups.com.
>> To unsubscribe from this group, send email to php-object-gener...@googlegroups.com.
>> For more options, visit this group at http://groups.google.com/group/php-object-generator?hl=en.
>>

Later,

Andy
--------
Yada, yada, yada...

The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336
Disclaimer: This e-mail and any attachments are confidential and intended solely for the use of the recipient(s) to whom they are addressed. If you have received it in error, please destroy all copies and inform the sender.


--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

Crispy

unread,
Jul 10, 2011, 11:55:45 PM7/10/11
to Php Object Generator
Hi Andy,

I don't have a "solution", but I have seen this sort of thing when the
tables are very big (many 10s of thousands) or one of the fields
contains data that is not processed correctly by the object interface
(e.g. maybe something like an html character or a single quote to
throw things off). If you have the option to use 'PHPMyAdmin' or
'MySQL Workbench' to take a look at the data, it might be actually A-
OK, and the object editor is bugged. If you do spot the problem maybe
it is something that can be patched.

be sure that you have also added the new database class, pog_object
and the setup files. I've forgotten to clear that out and update/
replace it with the new ones before, which causes a bit of wild goose
chases as well.

hope that gives something to try.

-Mark



On Jul 9, 1:42 pm, LAW Andy <andy....@roslin.ed.ac.uk> wrote:
> Joel,
>
> ** B****r!! **
>
> This is weird.
>
> Now that I look more closely, I discover that the data is *not* being cleared immediately, if I "Bypass Unit Tests". Rather, the POG interface is failing to display the data.  All fields are apparently intact, but not all fields are displayed. And, embarrassingly, it is not all the tables that are affected, just the *main* one in the system.
>
> If I include the Unit Tests, then the values in some fields in the table are being set to default, empty values.
>
> My current suspicions is one of the "enum" fields in the object/table, but given my poor track record at spotting the real problems in this scenario, I'm not sure.
>
> The object has three enums. Some of them are working, but the last one is not (i.e. it is not being displayed with the correct values in the POG "manage objects" interface). None of the date and time fields after the third enum are being displayed either.
>
> The values in the enum are nothing out of the ordinary (`fixturetype` enum('League', 'Cup', 'Friendly', 'Tournament', 'Training') NOT NULL,)
>
> The object has 15 fields, including the Id field.
>
> 4 of them are being blanked (the enum, a date field and two time fields). These are fields 5-8 in the object.
>
> I am deeply confused.
>
> On 9 Jul 2011, at 20:58, Joel Wan wrote:
>
>
>
>
>
>
>
>
>
> > Hi Andy,
>
> > The fields that are being emptied, are they date-specific fields? What
> > other fields clearing data?
>
> > I suspect the db is dropping the data when the update statement is
> > being called but I'm not sure why.
>
> > Sent from my iPhone
>
> > On 2011-07-09, at 11:28 AM, Andy Law <Andy....@roslin.ed.ac.uk> wrote:
>
> >> I've spent a frustrating few hours trying to upgrade a site that I run
> >> from version 2.6.3 to 3.0. I got the nusoap redeclaration error when I
> >> tried the "Upgrade" link (I've *never* got that to work properly), so
> >> I ended up regenerating the files one-by-one via the @link url.
>
> >> I replaced all the configuration and the base classes and all the
> >> other shenanigans and loaded up all my newly generated class file.
> >> Then I hit the setup scripts.
>
> >> And then I found that all the date fields and several others had been
> >> completely emptied.
>
> >> I reloaded the database from the backup and tried again. Same result.
>
> >> I've now backed out to the old 2.6.3 version and I'm sitting
> >> scratching my head.
>
> >> Anyone else seen this or - better - got a solution that I can use to
> >> stop this happening?
>
> >> Later,
>
> >> Andy
>
> >> --
> >> You received this message because you are subscribed to the Google Groups "Php Object Generator" group.
> >> To post to this group, send email to php-object...@googlegroups.com.
> >> To unsubscribe from this group, send email to php-object-gener...@googlegroups.com.
> >> For more options, visit this group athttp://groups.google.com/group/php-object-generator?hl=en.

LAW Andy

unread,
Jul 11, 2011, 4:50:55 AM7/11/11
to php-object...@googlegroups.com

On 11 Jul 2011, at 04:55, Crispy wrote:

> Hi Andy,
>
> I don't have a "solution", but I have seen this sort of thing when the
> tables are very big (many 10s of thousands)

Not an issue with this one. This is the "main" table, but the volumes are still very much smaller than that.

> or one of the fields
> contains data that is not processed correctly by the object interface
> (e.g. maybe something like an html character or a single quote to
> throw things off).

There are quotes and things in some of the fields, but they should be handled with the Base64 processing. The field that I *think* is triggering the grief is an enum field, so all the values in that column in the table are controlled.

> If you have the option to use 'PHPMyAdmin' or
> 'MySQL Workbench' to take a look at the data, it might be actually A-
> OK, and the object editor is bugged. If you do spot the problem maybe
> it is something that can be patched.


Further detective work shows that after "Aligning", but not running Unit tests, the data seem still to be intact. The first two enums show correctly in the object editor, but the last one is set to a default value as are a couple of subsequent date fields. Some later integer values are set OK and are visible in the editor.

Running the Unit tests seems to blank the data.


>
> be sure that you have also added the new database class, pog_object
> and the setup files. I've forgotten to clear that out and update/
> replace it with the new ones before, which causes a bit of wild goose
> chases as well.

This is running in a separate, freshly installed instance on a separate subdomain, so all the files are as downloaded from the 3.0f generator.


>
> hope that gives something to try.

Lots of things to try :o}

For my understanding, what do the Unit tests do? As far as I understood, they create new objects, set things on them, update them and delete them? Is that right?

If Yes, I'm struggling to understand why that would destroy values in other records in the table.

> For more options, visit this group at http://groups.google.com/group/php-object-generator?hl=en.

Reply all
Reply to author
Forward
0 new messages