Skip to content

different arrData between create and save - isAttributeSet get not the same returns #1158

@zonky2

Description

@zonky2

Checklist before I submit this issue report

I confirm that:

My environment is:

(Please fill in the actual values from your environment)

Key Value Comments
PHP version: 5.6
Contao version: 3.5.27
MetaModels version: core master (a15)
Installation via composer: yes
Installed MetaModels packages: bundle_all
DCG version: master (b39)

Steps to reproduce

  1. create attribute Alias with allwaysSave
  2. create input mask with readonly
  3. create and save items

look at contao-community-alliance/dc-general#350

at the "first save" (create) we doesn´t create the alias - we create the alias with the "second save" (update)

the MetaModels.php call the method modelSaved if is isAttributeSet true

if ($objItem->isAttributeSet($objAttribute->getColName())) {

but at Item.php
return array_key_exists($strAttributeName, $this->arrData);

we have different keys at array $this->arrData between create e.g.

Array (     [name] => a8     [vorname] => b8     [published] => 1     [tstamp] => 1496848172     [id] => 10 )

and update e.g.

Array (     [id] => 10     [pid] => 0     [sorting] => 0     [tstamp] => 1496848200     [name] => a8     [vorname] => b8     [email] =>      [published] => 1     [abteilung] =>      [alias] =>  ) 

Metadata

Metadata

Labels

bugA bug! A bug! Fast, squish it!

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions