Closed nvindice closed 4 years ago
The "modified" flag should be set whenever a value of an object changes. You may check why the setModified()
method is called, for which key and to what value. In 2019.10 and dev-master, this is rather easy because the set()
method is used by all set*()
methods internally:
https://github.com/aimeos/aimeos-core/blob/master/lib/mshoplib/src/MShop/Common/Item/Base.php#L127-L140
Well, IIUC even the standard implementation of loading a basket from the DB will trigger the modified
flag multiple times, as it uses the set*()
methods for setting up the price
object: https://github.com/aimeos/aimeos-core/blob/6c3e2d3ba34b85fa49100febaa86862b0e039ebb/lib/mshoplib/src/MShop/Order/Manager/Base/Standard.php#L966-L972
What sense does the modified
flag have when it is always true
? Or am I missing something?
There have been some cleanups recently to avoid setting the "modified" flag in those cases: https://github.com/aimeos/aimeos-core/commit/f4b2b009132ebca2918668dcc8beeeb1a86eb6c1
I see. Is it okay when I refactor 2018.x alike? Or is this too much change for a LTS?
It's too much and may have unpredictable results
Any other ideas on how to fix the ignore-modified
setting in the ProductPrice
plugin for 2018.x?
I developed a solution fitting only my current scenario using custom hidden attributes. So I'll close this issue, although it still might be an existig problem in 2018.x.
Hi @aimeos, we introduced a configuration option for the
ProductPrice
plugin in march, see #141 .However, I'm not so sure about this anymore. At least in my setup, the
setModified()
method of every price object in every product gets called multiple times at every action. This would render theProductPrice
plugin absolutely useless with activatedignore-modified
setting, as ultimately every price object would be "modified".Can you please clarify my understanding of the
modified
flag? When does it get set without manual action?