G6K icon indicating copy to clipboard operation
G6K copied to clipboard

displayable fields

Open houcemL opened this issue 3 years ago • 10 comments

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

houcemL avatar Apr 05 '21 20:04 houcemL

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:

  1. Rule R1 modifies the value of data D1.
  2. D1 triggers rule R2
  3. R2 modifies the value of D2
  4. D2 triggers rule R3
  5. R3 modifies the value of D1
  6. and hop, we go back to 2)

So check your rules!

eureka2 avatar Apr 05 '21 21:04 eureka2

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 ...

houcemL avatar Apr 05 '21 21:04 houcemL

Is your xml confidential? if not can you post it here?

eureka2 avatar Apr 05 '21 21:04 eureka2

<?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

houcemL avatar Apr 05 '21 21:04 houcemL

I cannot run your XML because it is malformed

eureka2 avatar Apr 05 '21 21:04 eureka2

i just edit my comment deleting all content from CDATA you can add manually some text

houcemL avatar Apr 05 '21 21:04 houcemL

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.

houcemL avatar Apr 05 '21 21:04 houcemL

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

houcemL avatar Apr 05 '21 22:04 houcemL

Fixed in release 4.4.8 ! thks fo reporting

eureka2 avatar Apr 07 '21 18:04 eureka2

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;

houcemL avatar Apr 08 '21 08:04 houcemL