Convert returned Tamper-object to array

Created on 2 October 2023, 12 months ago
Updated 3 October 2023, 12 months ago

Problem/Motivation

While using the Encode-Tamper plugin (mode = json_decode) I encountered an error when the returned object was assigned to the configured token. The following message was logged when setting the object as value of a DTO-instance: Invalid values given. Values must be represented as an associative array..
After a discussion with JΓΌrgen Haas on Slack, there was a proposal to add a safety net inside this module to ensure that the valid output of a Tamper-plugin is correctly saved, aka converting the object to an array.

Steps to reproduce

* Create a separate test inside eca_tamper for the Encode-plugin
* Give it a valid json-encoded string
* Try to assign that value to a DTO-object

Proposed resolution

* Create said unit-test
* Add is_object-condition before assigning the value to a token

Remaining tasks

See proposed solution.

User interface changes

n/a

API changes

n/a

Data model changes

n/a

πŸ“Œ Task
Status

Needs work

Version

1.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium lammensj

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @lammensj
  • @lammensj opened merge request.
  • Status changed to Needs review 12 months ago
  • Status changed to Needs work 12 months ago
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    Nice MR, I like your approach and the test a lot. Left a couple of notes and wondered if we could simplify the overall code by their suggestions. Happy to discuss those, though.

Production build 0.71.5 2024