quickapps / cms

Modular CMS powered by CakePHP
GNU General Public License v3.0
164 stars 69 forks source link

Error Association when update cake 3.1.x -> 3.2.x #141

Closed LeLuyen closed 8 years ago

LeLuyen commented 8 years ago

Hi Chris, Here is error when update from cakephp 3.1.x to 3.2.x

Warning (512): Association property name "created_by" clashes with field of same name of table "contents". You should explicitly specify the "propertyName" option. [CORE/src/ORM/Association.php, line 446]

The logs: 2016-03-21 07:04:42 Warning: Warning (512): Association property name "modified_by" clashes with field of same name of table "contents". You should explicitly specify the "propertyName" option. in [/var/www/html/laovietbank/webroot/quickappscms/vendor/cakephp/cakephp/src/ORM/Association.php, line 446] Trace: Cake\Error\BaseErrorHandler::handleError() - CORE/src/Error/BaseErrorHandler.php, line 146 Cake\ORM\Association::property() - CORE/src/ORM/Association.php, line 446 Cake\ORM\EagerLoader::_normalizeContain() - CORE/src/ORM/EagerLoader.php, line 435 Cake\ORM\EagerLoader::normalized() - CORE/src/ORM/EagerLoader.php, line 252 Cake\ORM\EagerLoader::attachableAssociations() - CORE/src/ORM/EagerLoader.php, line 377 Cake\ORM\EagerLoader::attachAssociations() - CORE/src/ORM/EagerLoader.php, line 348 Cake\ORM\Query::_transformQuery() - CORE/src/ORM/Query.php, line 947 Cake\ORM\Query::sql() - CORE/src/ORM/Query.php, line 901 Cake\Database\Driver\Mysql::prepare() - CORE/src/Database/Driver/Mysql.php, line 121 Cake\Database\Connection::prepare() - CORE/src/Database/Connection.php, line 216 Cake\Database\Connection::run() - CORE/src/Database/Connection.php, line 268 Cake\Database\Query::execute() - CORE/src/Database/Query.php, line 188 Cake\ORM\Query::_execute() - CORE/src/ORM/Query.php, line 921 Cake\ORM\Query::_all() - CORE/src/Datasource/QueryTrait.php, line 272 Cake\ORM\Query::all() - CORE/src/ORM/Query.php, line 871 Cake\Controller\Component\PaginatorComponent::paginate() - CORE/src/Controller/Component/PaginatorComponent.php, line 171 Cake\Controller\Controller::paginate() - CORE/src/Controller/Controller.php, line 688 Content\Controller\Admin\ManageController::index() - ROOT/vendor/quickapps-plugins/content/src/Controller/Admin/ManageController.php, line 64 Cake\Controller\Controller::invokeAction() - CORE/src/Controller/Controller.php, line 429 Cake\Routing\Dispatcher::_invoke() - CORE/src/Routing/Dispatcher.php, line 114 Cake\Routing\Dispatcher::dispatch() - CORE/src/Routing/Dispatcher.php, line 87 [main] - ROOT/webroot/index.php, line 37

botchris commented 8 years ago

Interesting, I think it may be WhoDidIt behavior that is causing this.(https://github.com/quickapps/cms/blob/2.0/plugins/User/src/Model/Behavior/WhoDidItBehavior.php#L80).

Don't know if it's a Cake bug or just intentioned... I mean "ModifiedBy" clashing with "modified_by"... really? (seems like some sort of inflection somewhere in Cake's core).

Anyway, we'll take a look soon as possible, thanks for reporting!