cake/libs/model/cake_schema.php clobbers table in 'cake schema generate' output
Reported by tomws | June 3rd, 2010 @ 05:20 PM | in 1.3.1
Commit af6435ece8ced3a83ba9 (to cake/libs/model/cake_schema.php) breaks the results of 'cake schema generate' (and 'dump') in some circumstances. In my case, it "forgets" the acos table in the output schema.php. I have not been able to contrive an example outside of my app, however.
If I'm not mistaken, line 266 in the read() function was overlooked during the round of variable name changes from that commit.
$key = array_search($table, $currentTables);
should be
$key = array_search($withTable, $currentTables);
Otherwise, since the $table key of $currentTables has been
previously unset (see line 256), $key here is assigned false and
this results in $currentTables[0] being unset on line 270. In my
case, that happened to be the acos table which was completely
unrelated but sitting in position zero in the $currentTables
array.
As stated, I can't create an example, but I'd be happy to code dump on someone if you need something to test. The change above, however, fixed the problem here.
Comments and changes to this ticket
-

tomws June 3rd, 2010 @ 05:21 PM
- → Tag changed from cake schema, aco to cake schema
-

Mark Story June 3rd, 2010 @ 09:28 PM
- → Milestone set to 1.3.1
- → Tag changed from cake schema to cakeschema, defect, read
- → Assigned user set to Mark Story
-

CakePHP June 3rd, 2010 @ 10:21 PM
- → State changed from new to resolved
(from [bd6e16be261d532da30d417e48c7f57c9be21550]) Fixing issue where join tables would be filed under 'missing' and found. Test added. Fixes #789 http://github.com/cakephp/cakephp/commit/bd6e16be261d532da30d417e48...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
Source available from github
Repository is at http://github.com/cakephp/cakephp
Creating a bug report
When creating a bug report, please include as much relevant information as possible. Please include code to reproduce the issue. Or even better, make a unit test. Either change an existing test or add a new test to show that the expected behavior is not occuring.
People watching this ticket
Tags
Referenced by
-
#789 cake/libs/model/cake_schema.php clobbers table in 'cake schema generate' output
(from [bd6e16be261d532da30d417e48c7f57c9be21550])
Fixing ...