Publisher does not support the Fluid field type. Please do not contact asking when support will be available.
If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.
Ticket: FormSecret
Status | Resolved |
Add-on / Version | Bloqs 4.2.1 |
Severity | |
EE Version | 5.3.0 |
Jelle Dijkstra
Jan 07, 2020after updating to this version i’m getting a php error on saving entries, and when editing/creating an entry with bloqs fields
Argument 1 passed to BoldMinded\Bloqs\Service\FormSecret::setSecret() must be an instance of BoldMinded\Bloqs\Service\int, string given, called in user/addons/bloqs/ft.bloqs.php on line 225 and defined
user/addons/bloqs/Service/FormSecret.php, line 74
BoldMinded (Brian)
Jan 07, 2020
Jelle, did you try to replicate this with a brand new install of EE? I’ve tried to replicate this on two environments and can’t. This also seems like the sort of issue that I’d be getting multiple reports about, but I haven’t. Try adding this var_dump and see what it prints
Line 75 of that FormSecret file:
Jelle Dijkstra
Jan 07, 2020
looks like it returns string(1) “7”
Jelle Dijkstra
Jan 07, 2020
Comment has been marked private.
BoldMinded (Brian)
Jan 07, 2020
Line 225 of ft.bloqs.php contains this: $secretService->setSecret($this->field_id);
Add (int) in front
See if that fixes it. I’m a little confused at why yours is a string and mine is an actual integer without having to cast it as an int, which is why I asked if you had tested this on a brand new EE install to see if another add-on is maybe messing with the field_id property.
Jelle Dijkstra
Jan 07, 2020
Doesn’t have an effect. hoever might this not be that the license i got from EE is a string and has characters and dashes in it?
BoldMinded (Brian)
Jan 07, 2020
Add-on license should have nothing to do with that error.
Adding (int) should definitely fix the error you reported, which was that the function expects an integer, and adding (int) casts a string to an int.
Jelle Dijkstra
Jan 07, 2020
fyi it now returns int(7)
BoldMinded (Brian)
Jan 07, 2020
If that is the case, then it should not throw that initial error you were seeing and should submit fine. Is that the case?
Jelle Dijkstra
Jan 07, 2020
hmm nope…
the bloqs field shows Argument 1 passed to BoldMinded\Bloqs\Service\FormSecret::setSecret() must be an instance of BoldMinded\Bloqs\Service\int, integer given, called in user/addons/bloqs/ft.bloqs.php on line 225 and defined
user/addons/bloqs/Service/FormSecret.php, line 74
found another instance of the setfield on line 335. i changed line 335 from ft to $secretService->setFieldId((int) $this->field_id);
after save getting Error
Argument 1 passed to BoldMinded\Bloqs\Service\FormSecret::setFieldId() must be an instance of BoldMinded\Bloqs\Service\int, string given, called in user/addons/bloqs/ft.bloqs.php on line 335 and defined
user/addons/bloqs/Service/FormSecret.php, line 146
BoldMinded (Brian)
Jan 07, 2020
What version of PHP are you using?
BoldMinded (Brian)
Jan 07, 2020
Comment has been marked private.
Jelle Dijkstra
Jan 07, 2020
quickly flipped the php version of the server and errors went away. stupid stuff but another site or 2 on that server stille depend on php 5.6. thanks for the help!