Hello everyone.
Recently the updated Form plugin broke Add-Page-By Form, and it would not create any new pages from the front end. Add-Page-By Form is an old plugin that has worked on all previous versions with the form plugin that Ive used. As many here will know, Add-Page-By Form has not been updated for a long time but nevertheless always worked.
The error it made was Call to a member function toArray() on array
this error is listed in the release changelogs in Form version v9.1.12 as a bugfix, but even Form v9.1.11 did not work. The last Form version that does not break Add-Page-By Form is Form v9.1.10. I have tested previous versions to this and they all work to at least Form v8.2.1. I intend to test random Form versions that are much more recent to see if they work - eg Form v9.1.25, but do not expect them to work.
- the recent updated Form plugin that broke Add-Page-By-Form is Form v9.1.35
- the 'last' Form plugin that works is v9.1.10
NB I also use the Form plugin for logging into the front end. The updated Form plugin did not break this. I do not fully understand how grav forms work because its very complicated to a non grav dev. But I got these forms to work relatively easily and they have worked for at least 2 years.
Add-Page-By-Form
The yaml I use to create a new page from the front end
form:
name: add_page.blogpost
classes: add-page
fields:
-
name: title
label: title
type: text
-
name: taxonomy.tag
label: 'tags (comma sep)'
type: text
# -
# name: featured
# label: featured
# type: text
-
name: starred
label: 'starred'
type: checkbox
default: false
-
name: content
label: 'content (editable)'
type: textarea
size: long
classes: editor
-
name: honeypot
type: honeypot
buttons:
-
type: submit
value: create
process:
-
timestamp:
name: timestamp
-
add_page: true
-
redirect: /notes
---
Maybe people will have ideas or even a simple tech solution to this. I think its safe to edit Add-Page-By-Form as it is no longer updated.