-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ignoreUnknownColumns=>true fails on Model::save() #11907
Comments
I was wondering if I could get someone's attention to this issue? There's 9 months it was opened, and got no reply 🤔 To help figure out what's going on, I tried to reproduce it in a simple project: I forked the sample project Invo, placed it into a dockerized environment with the new Phalcon 3, and created a branch with the problem. Actually, I couldn't even get
|
I'll take a look as soon as I can. Thank you for contributing |
I have the same problem on phalcon 3.2.1. |
@Druid33 @igorsantos07 could you try add to php.ini on proper sapi:
And restart your webserver/php-fpm and check again? This is just a guess. |
Sorry! I'm not on the project anymore 😔
Redirecting this to @gte451f
…On Sep 7, 2017 05:55, "Wojciech Ślawski" ***@***.***> wrote:
@Druid33 <https://github.com/druid33> @igorsantos07
<https://github.com/igorsantos07> could you try add to php.ini on proper
sapi:
phalcon.orm.ignore_unkown_columns = 1
And restart your webserver/php-fpm and check again? This is just a guess.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#11907 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAgfSwKwWHdeutMPM0JdzQumniowZ8hjks5sf69_gaJpZM4I5Adc>
.
|
adding |
Your added it to correct sapi and restarted your webserver? |
@Druid33 There is any chance to test |
Thank you for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please feel free to either reopen this issue or open a new one. We will be more than happy to look at it again! You can read more here: https://blog.phalconphp.com/post/github-closing-old-issues |
the problem it's that orm generate metada from database and not from custom model. if you put one method in yur parent class for all models like this: use Phalcon\Mvc\Model\MetaData\Strategy\Annotations;
now, metada is generated from your model and you can add columns in your database without touch your model. |
I am getting this error with Phalcon\Mvc\Model\Resultset\Simple::toArray() with Phalcon 3.4.5. Is this supposed to be solved? |
While enabling ignoreUnknownColumns do allow us to not specify repeated column names on columnMaps (as per a comment in another issue, as this is nowhere to be found in the docs), it still triggers
Column 'blah' isn't part of the column map
. In the stacktrace, it was triggered insidePhalcon\Mvc\Model->_preSave()
.This was found under 2.0.11 and then tested under 2.0.13 and 2.1.0 RC1 (7992678), both still displaying this issue.
Sample steps to reproduce:
id, name, age
['name' => 'fullName']
find()
on it or something similar, it will trigger a columnMap error (as theage
field is missing in the columnMap definition)\Phalcon\Mvc\Model::setup(['ignoreUnknownColumns' => true])
will clear up thefind()
errorsave()
on the said modelThe text was updated successfully, but these errors were encountered: