0 votes

Hi,
I have two issues with Gedmo behaviors

1) Skipper is not supporting multiple values for Blameable and Translatable behaviors when using type "change"

enter image description here

Current output:

* @Gedmo\Timestampable(on="change", field="order_service_status_key", value="{"realized", "cancelled"}")

Expected output:

* @Gedmo\Timestampable(on="change", field="order_service_status_key", value={"realized", "cancelled"})

2) I'm not able to specify field for association. My field orderservicestatus_key is an association named status for entity with fields key and name. I can change it directly in xml and it works. I would like to set field as "status.key". So proper output from previous example should be:

* @Gedmo\Timestampable(on="change", field="status.key", value={"realized", "cancelled"})

In this github issue was a proper similiar example of using association field (3rd comment, field: status.title):
https://github.com/Atlantic18/DoctrineExtensions/issues/1428

I'm using newest Skipper v3.2.10.1370

EDIT: It works when I name field as "status.key" in Gedmo instead of default orderservicestatus_key. This is acceptable for me, so this bug report is only for multiple values for "change" type.

asked Apr 25 in Solved by s.zinkiewicz (170 points)
recategorized Sep 8 by ludek.vodicka

Thanks for info. We will check it

1 Answer

0 votes
Best answer

Hi,

we're just checking your issue. To be able to fix it propertly we would need to know what is the correct form also for YML and XML formats.

There is no mention in documentation about mulitple values in "value" property. So, to be able to fix it correctly, we need to know format for

  publishedBy:
      type: string
      gedmo:
        blameable:
          on: change
          field: type.title
          value: Published

as same as for

    <field name="publishedBy" type="string" nullable="true">
        <gedmo:blameable on="change" field="status.title" value="Published"/>
    </field>

The only explanation for this field is:

value - only valid if on="change" is specified and the tracked field
is a single field (not an array), if the tracked field has this value
then it updates the blame

answered May 25 by ludek.vodicka Skipper developer (125,470 points)
selected Sep 8 by ludek.vodicka

I just checked it out.

For YamlDriver should be:

finishedAt:
  type: datetime
  nullable: true
  column: finished_at
  gedmo:
    timestampable:
        on: change
        field: statusKey
        value: ["cancelled","finished"]

BUT... When I exported my project to YAML, my output is:

finishedAt:
  type: datetime
  nullable: true
  column: finished_at
  gedmo:
    - timestampable:
        on: change
        field: statusKey
        value: ["cancelled","finished"]

This dash before timestampable is unnecessary and it's not working with it.

For XmlDriver, i think this is not supported. I don't know how to pass an array to xml as an attribute. Here any attribute is casting as a string.

I found one another similiar issue with Sortable behaviors. I would like to setup group for two fields, but in skipper I only can set one field for SortableGroup. I can bypass this by setting two separate Sortable behaviors for i.e. first sortPos field and grouping by fieldA, and second also for sortPos field and grouping by fieldB.
After export I have proper setup for SortableGroup fields, and two rows for SortablePosition. It works even if I remove one unnecessary sortablePosition annotation. Any another export doesn't make any changes in files.

Will it be implemented in the next Skipper version?

Hi Silvestr, sorry to not reply you before. I somehow missed notification of your previous comment. We will check it and let you know.

Regarding yml output and "- timestampable" vs "timestampable".

This is something I already commented before, it's because yml export is non determinant in Gedmo behaviours and because of that it's not possible to export it correctly in all situations (some behaviours require -form and some don't).

Also as stated by Doctrine2 developers YML format will be completely cancelled and only XML and annotations will remain. So we no longer update/modify yml exports. More details here https://support.skipper18.com/2838/soft_deleteable-broken-following-recent-skipper-upgrade?show=2838#q2838

Regarding XML output, in case that there is typecast to string it's not necessary to solve it. Bwt, this is one of many situations where Gedmo handles one thing in different ways (yml vs xml vs annotations).

Required feature is released in latest beta https://support.skipper18.com/402/downloads-skipper-beta

You can use existing format {"v1","v2"} to get required result.. Please let me know if it works as expected

Now it works as expected. Thank you.

You're welcome