G6K
G6K copied to clipboard
displayable fields
https://github.com/eureka2/G6K/blob/3fe4dc0488aa12475061f7f74194b2ce00f5ad6a/src/G6K/Controller/BaseController.php#L771
Hello
Refering to the LOC the algorithm consider the step diplayable when at least one field is displayable. What if we have one field displayable = true and another false ? or there is a certainty that if one field is displayable all the others are ?
What if we want to make a pure informatif step with no fields ? i already try to make so all is goog the xml is valid but all what i'v got is a infinit loop testing the result with try it
Ths
if no field is displayable, the step is skipped but this does not cause an infinite loop.
infinite loops can be caused when executing business rules. For example:
- Rule R1 modifies the value of data D1.
- D1 triggers rule R2
- R2 modifies the value of D2
- D2 triggers rule R3
- R3 modifies the value of D1
- and hop, we go back to 2)
So check your rules!
Ths for your reactivity
Actually for my infint loop i have no business rule, no fields or group of field even i have no data, all what i do is defining a step with a section with some text
In the algorithm if we have one field displayable we consider the step it self displayable ...
Is your xml confidential? if not can you post it here?
<?xml version="1.0" encoding="utf-8"?> <Simulator xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../doc/Simulator.xsd" name="testhbh" label="testhbh" category="hbh" defaultView="particuliers" referer="" dynamic="0" memo="0" locale="fr-FR" timezone="Europe/Paris"> <Description edition="wysihtml"><![CDATA[]]></Description> <DataSet dateFormat="d/m/Y" decimalPoint="," groupingSeparator=" " groupingSize="3" moneySymbol="€" symbolPosition="after" arbotypePage="cerfa" dateLastVerfied="" userNameLastSave="admin" dateLastSave="2020-12-29 12:27:39" envLastSave="LOCAL" blockTitle="" additionalInformation="" startButtonTitle="" CloseButtonTitle="" FieldReceivingFocus=""> </DataSet> <Steps> <Step output="normal" id="1" name="step" label="step" template="pages:article.html.twig" dynamic="1"> <Panels> <Panel id="1" name="paneau" label=""> <BlockInfo id="1" name="info" label="inf"> <Chapter id="1" name="chap" label="label" collapsible="1"> <Section id="1" name="section" label="" role=""> <Content edition="wysihtml"><![CDATA[]]></Content> <Annotations edition="wysihtml"><![CDATA[]]></Annotations> </Section> </Chapter> </BlockInfo> </Panel> </Panels> </Step> </Steps> </Simulator>
This is the xml causing infinti loop in our custom version of your work
I cannot run your XML because it is malformed
i just edit my comment deleting all content from CDATA you can add manually some text
the main idea to reproduce the behavior is to define a simulator with a step with a panel with a bloc of information with a chapter with a section with some text. nothing else. no data no group of fields no fields nor rules.
i fixed with default value $direction = 1; don't sure if i will have some regressions.
but still don't understand the stepDisplayable meaning https://github.com/eureka2/G6K/blob/3fe4dc0488aa12475061f7f74194b2ce00f5ad6a/src/G6K/Controller/BaseController.php#L522
Fixed in release 4.4.8 ! thks fo reporting
ths this resolve the behavor but still have some idéas, what if we consider a step displayable if all block info displayable or all field displayable ? we will have a while condition like this
} while ($stepDisplayableInfos && $stepDisplayableFields && $istep > 0 && $istep <= $stepCount);
and these two flags are initialized as true in the begening of each step processing
do { $stepDisplayableFields = true; $stepDisplayableInfos = true;