Skip to content
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

Add incorrect field to model in storage after touching her #27791

Closed
Smolevich opened this issue Mar 5, 2019 · 8 comments
Closed

Add incorrect field to model in storage after touching her #27791

Smolevich opened this issue Mar 5, 2019 · 8 comments

Comments

@Smolevich
Copy link

  • Laravel Version: 5.8.2
  • PHP Version: 7.3.2
  • Database Driver & Version: mongodb

I use library https://github.com/jenssegers/laravel-mongodb and if model was touched by method touch in collection to document will added new field collection_name.updated_at and original field updated_at stay with old value. Broken commit 6484744.

Steps To Reproduce:

Create model, save her, and touch after . Example in tests

public function testTouchingChildModelUpdatesParentsTimestamps()

@Smolevich Smolevich changed the title https://github.com/laravel/framework/commit/6484744326531829341e1ff886cc9b628b20d73e Add incorrect field Mar 5, 2019
@Smolevich Smolevich changed the title Add incorrect field Add incorrect field to model in storage after touching her Mar 5, 2019
@mfn
Copy link
Contributor

mfn commented Mar 6, 2019

Isn't this an issue with the other package, i.e. see mongodb/laravel-mongodb#1720 ?

@Smolevich
Copy link
Author

Isn't this an issue with the other package, i.e. see jenssegers/laravel-mongodb#1720 ?

Package jenssegers/laravel-mongodb inherits all parts of eloquent models, that i think to fix this problem in laravel

@rennokki
Copy link
Contributor

rennokki commented Mar 6, 2019

@mfn AFAIK this is the line that is executed before the whole thing collapse:

https://github.com/mongodb/mongo-php-library/blob/1.4.2/src/Operation/Update.php#L179

@driesvints
Copy link
Member

Seems like this needs to be fixed upstream.

@Smolevich
Copy link
Author

@driesvints, what do you mean under upstream?

@driesvints
Copy link
Member

@Smolevich
Copy link
Author

@driesvints, What is reason this [changes]?(6484744)
Am I to understand that library laravel-mongodb in cases broken changes must redefine parent methods of laravel eloquent entities?

@driesvints
Copy link
Member

Here's the PR: #26997

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants