-
Notifications
You must be signed in to change notification settings - Fork 289
N°9622 - Error in the user story life cycle #915
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
base: develop
Are you sure you want to change the base?
Changes from all commits
c347b96
3ff6502
61661fb
02ce3d9
490bc4f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3240,7 +3240,13 @@ public function DisplayStimulusForm(WebPage $oPage, $sStimulus, $aPrefillFormPar | |
| $aAllowedValues = MetaModel::GetAllowedValues_att($sClass, $sAttCode, $aArgs); | ||
| if (is_array($aAllowedValues) && count($aAllowedValues) == 1) { | ||
| $aValues = array_keys($aAllowedValues); | ||
| $this->Set($sAttCode, $aValues[0]); | ||
| if ($oAttDef->IsLinkSet()) { | ||
| $oObjectSet = $this->Get($sAttCode); | ||
| $oObjectSet->AddItem(MetaModel::GetObject($oAttDef->GetLinkedClass(), $aValues[0])); | ||
| $this->Set($sAttCode, $oObjectSet); | ||
|
Comment on lines
+3243
to
+3246
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For an |
||
| } else { | ||
| $this->Set($sAttCode, $aValues[0]); | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there any way $aValues contains more than one single value?
can you add a test that cover DisplayStimulusForm with this new fixed usecase (linkset), pls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if GetObject throws an exception when object does not exist? if it could happen, it could be nice for support team to catch the exception, log it and return false (i guess?).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the attribute is a LinkSet, GetAllowedValues_att returns an ObjectSet from an OQL query. Therefore, I believe this object must exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And to answer the first question, it is impossible for $Values to contain more than one value, because the test count($allowedValues) == 1 was performed just before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok technically it is not possible. you are right (count==1).
so functionally this PR fixes stimulus form display of current object, by adding first found allowed value to the linkset, right? no all possible allowed values. one is enough...
if there is one value to add, cant it be default one if it exists? maybe it does not make sense?