Not a Valid Integer - Bug 5.52.0
Overview
Please describe your problem or bug in detail. When making a traditional mailing or Mosaico mailing on CiviMail, I am trying to create a mailing but my select2 dropdowns are not interpreting the options correctly so it is display as blanks.
When i try to update them, it says the id is not valid.
Reproduction steps
- Click on Mailings -> New Mailing (Traditional) or New Mailing.
- Click on Responses or Publication and wait for the event listener to fire off.
- Got an error "optout_id is not a valid integer" or something similar.
Current behaviour
What happens currently. Please provide error messages, screenshots or gifs (LICEcap, SilentCast) where appropriate.
When i try setting them i get these errors:
Looking at my debug console and network request, the following POST errors are generated:
{"error_field":"optout_id","type":"integer","error_code":2001,"entity":"Mailing","action":"create","is_error":1,"error_message":"optout_id is not a valid integer"}
with the payload sending this in the optout_id slot of the json payload
"optout_id":"string:7"
Clearly i believe that the value should be 7, but it is coded as a string:7
I suspect that this is a parsing issue with a JS resource sent to me because the GET response of:
page: CiviCRM q: civicrm/ajax/rest entity: Mailing action: getsingle json: {"id":"ID#"}
returns valid integers:
"reply_id": "8", "unsubscribe_id": "5", "resubscribe_id": "6", "optout_id": "7",
Expected behaviour
What should happen.
The event listener should pass an integer instead of a string saying string:7
Environment information
- Browser: Edge 104.0.1293.47/Firefox 103.0.2
- CiviCRM: Master/5.52.0...
- PHP: 7.0/7.1/7.2/7.3/..._
- CMS: WordPress 5.9.3...
- Database: MariaDB 10.8/...
- Web Server: Apache ...
Comments
Anything else you would like the reviewer to note.