Entity deletion/delete not being processed

Created on 2 March 2023, over 1 year ago
Updated 3 March 2023, over 1 year ago

Entityform using the load function from the entity controller to load the entity to then process for deletion, but erroring out when executing the delete action.

The load function is expecting an array, but an integer is instead passed through. So to ensure an array is passed, typecast the $id parameter in the function to ensure it's an array that is processed through the function, so it gets properly processed.

πŸ› Bug report
Status

Needs review

Version

1.10

Component

Core integration

Created by

πŸ‡¦πŸ‡ΊAustralia j-henriquez

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

Comments & Activities

  • Issue created by @j-henriquez
  • Status changed to Needs review over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia
  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

    So if I understand correctly, some code is passing a non-array to this function?

    That is wrong. Rather adding all sorts of checks to the Entity API to make sure this is an array, why don't you fix the actual code that is doing the wrong thing?

    I would be in favor of type hinting the parameter to ensure an array is passed, but I don't see the need to do a cast in the Entity API to coerce the input to be an array.

  • πŸ‡¦πŸ‡ΊAustralia j-henriquez

    I was coming back to the issue to make this comment. I've changed the code so it parses an array to the function as it expects it.

    Ideally, there should be an exception thrown by the load function, that the value being parsed through isn't an array.

Production build 0.71.5 2024