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

it´s not possible to save at readonly and alwaysSave #350

Closed
zonky2 opened this issue Jun 8, 2017 · 1 comment
Closed

it´s not possible to save at readonly and alwaysSave #350

zonky2 opened this issue Jun 8, 2017 · 1 comment
Assignees
Labels
Milestone

Comments

@zonky2
Copy link
Contributor

zonky2 commented Jun 8, 2017

as additional to #319

it´s not possible to save at readonly and alwaysSave

we can change to

        foreach ($propertyValues as $property => $value) {
            try {
                if (!$properties->hasProperty($property)) {
                    continue;
                }

                $extra = $properties->getProperty($property)->getExtra();

                // Don´t save value if isset property readonly.
                if (empty($extra['readonly'])) {
                    $model->setProperty($property, $value);
                }

                // If always save is true, we need to mark the model as changed.
                if (!empty($extra['alwaysSave'])) {
                    $model->setMeta($model::IS_CHANGED, true);
                }
            } catch (\Exception $exception) {
                $propertyValues->markPropertyValueAsInvalid($property, $exception->getMessage());
            }
        }

but MetaModels work different between create and save - look at MetaModels/core#1158

@zonky2 zonky2 added the bug label Jun 8, 2017
@zonky2 zonky2 added this to the 2.0.0 milestone Jun 8, 2017
zonky2 added a commit to zonky2/dc-general that referenced this issue Aug 12, 2017
baumannsven added a commit that referenced this issue Aug 23, 2017
…into hotfix/beta-40

* hotfix_#350_save_alias_and_combined_vaues_if_readonly:
  Hotfix #350 save alias  or combined values if readonly and force alias
@baumannsven
Copy link
Member

Merged in 196a5e7

baumannsven added a commit that referenced this issue Aug 24, 2017
* hotfix/beta-40:
  Hotfix #350 save alias  or combined values if readonly and force alias
  Hotfix #342 set standard at sortgroup
  Add GitHub templates (closes #304)

# Conflicts:
#	src/Controller/DefaultController.php
#	src/Data/DefaultDataProvider.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants