Simple Contact does not work

The plugin Simple Contact causes the error "Access level to Grav\Plugin\SimpleContactPlugin::mergeConfig() must be protected (as in class Grav\Common\Plugin) or weaker ". What have I done wrong?

Are you running the latest version of both Grav and the plugin? easy way to check is to type:

bin/gpm version to find latest Grav version
bin/gpm update to find plugin and theme udpates

I downloaded the plugin from the repository. It’s a ftp installation therefore I cannot use bin/gpm update. By the way: The demo in the repository does not work.

I downloaded the newest version from GitHub and now it works.

Cool.

Using Grav 0.9.26 and SimpleContact 1.0.4 (from GitHub master) this problem persists on the Grav Vagrant environment. Did the 0.9.26 update break it again?

Nothing in the latest version should of affected this. Basically mergeConfig() was added to Grav some time ago. The SimpleContact plugin was updated shortly after to use this new method.

SInce then nothing has changed regarding this function.

I just noticed the release/1.0.5 branch, which for some reason is ahead of the develop branch. This at least solves the Access level error, but it is not clear why the namespace was switched from “simplecontact” to “simple_contact”.

Yah there was a naming update at some point. He requested we update it in GPM.

Not quite sure what I’m doing wrong here, I am using the 1.0.5 release from the current develop branch, with the same setup as suggested by the readme (added simple_contact: true below title: Something in page.md), but no form shows up. Could this be from the change in naming? I read from the documentation that underscores and the like should be avoided in plugin name.

On markdown page, where you want your contact form to be displayed add:

process:
  twig: true
simple_form:
  token: "your-token-here"

and on twig template file (if it’s not implemented in your template)

{% if config.plugins.simple_form.enabled %}
   {% set simple_form_config = page.header.simple_form ?: config.themes.TEMPLATE-NAME-HERE.simple_form %}
   {{ simple_form(simple_form_config) }}
{% endif %}

This will make your form to show up. I know it sounds a little bit messy, but right now I think it’s the only way…

This post helpme to make simple_contact 1.0.4 to show, developer change name.

@Karol, simple_form is from same developer, but totally different than simple_contact.

Ahh… you are right :slight_smile: sorry about that :slight_smile: I’m glad you got it working though

I’m using 1.0.5, which is the most up-to-date on GitHub, but nothing shows up regardless.

@gingah are you working in a local enviroment?, I had some problems working with wamp, I dont have an idea why but the simple_contact template twig file was not render at all, so I add this line:

{{ estonoesnada }}

at the very begining of the plugins/templates/simple_contact/form.html.twig and it works. In my sitegrownd shared hosting works with and without that line.
here is the website

Yes, I’m currently using the Grav Vagrant for development, though that should not have an effect here is no other template fails to render. Weirdly, adding that {{ estonoesnada }} (or {{ lol }} for that matter) does cause the template to render. The plugin does seem to be a bit unstable from all of this, might be easier to just roll a standard contact-form myself.

Why don’t you try in a production server, I believe the developer may fix it if we can show him how to reproduce the problem.

I’ll push the ready site to production, but I prefer to develop locally. At any rate, the plugin only adds a basic HTML-scaffold for the form - the css and js are practically empty - and a PHP-class for the processing. Something similar but operable would not take much effort, and I basically just need a plain contact-form.

Side note: If your template fails to render or If you have like a blank .md file with headers only, insert at least one breaking space (enter) after the header (after three dashes).
Also rendering of the template may fail if markdown file is not indented properly.
Also, correct me if I’m wrong, markdown file can’t be empty :slight_smile:

Actually that particular bug should be fixed in Grav. Are you updated with the latest Karol?