HasOneSQL::addField does not support save (editable)#933
Closed
HasOneSQL::addField does not support save (editable)#933
HasOneSQL::addField does not support save (editable)#933Conversation
mvorisek
commented
Nov 26, 2021
| public function isEditable(): bool | ||
| { | ||
| return $this->ui['editable'] ?? !$this->read_only && !$this->never_persist && !$this->system; | ||
| return $this->ui['editable'] ?? !$this->read_only && !$this->never_persist && !$this->never_save && !$this->system; |
Member
Author
There was a problem hiding this comment.
what is the real difference between read_only and never_save?
Member
Author
There was a problem hiding this comment.
@DarkSide666 @abbadon1334 @georgehristov any idea?
Member
Author
There was a problem hiding this comment.
suggestion from chat:
return $this->ui['editable'] ?? !$this->read_only && !$this->system;
Member
Author
There was a problem hiding this comment.
I tried the condition above and it does not fix the atk4/filestore issue described in #929
14b72b5 to
baf72e6
Compare
baf72e6 to
96ee7a4
Compare
c4af374 to
93c4c30
Compare
93c4c30 to
adca6a9
Compare
adca6a9 to
e22abb4
Compare
2d343ee to
ad01b0d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #929
expected behaviour seems described in
data/src/Model/FieldPropertiesTrait.php
Lines 97 to 105 in 5c411d2
but there are some hooks I do not fully understand their general purpose
https://github.com/atk4/data/blob/develop/src/Reference/HasOneSql.php#L49-L59
and
HasOneclass has thesehttps://github.com/atk4/data/blob/develop/src/Reference/HasOne.php#L77-L114
but these are not used for
HasOneSql::addField, as field is created usingrefLinknadrefis not called at all@georgehristov @DarkSide666 @ibelar what do you think, what should be the expected behaviour and how to resolve the issue above?