** 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.
> 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.