Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Simple Contact does not work

Started by Muut Archive 11 years ago · 25 replies · 1032 views
11 years ago

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?

11 years ago

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

11 years ago

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.

11 years ago

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

11 years ago

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?

11 years ago

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.

11 years ago

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".

11 years ago

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

11 years ago

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.

11 years ago

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

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

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

TWIG
{% 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..

11 years ago

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.

11 years ago

Ahh.. you are right :) sorry about that :) I'm glad you got it working though

11 years ago

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

11 years ago

@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:

TWIG
{{ 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

11 years ago

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.

11 years ago

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.

11 years ago

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.

11 years ago

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 :)

11 years ago

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

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1329 9 years ago
Archive · by Muut Archive, 9 years ago
2 922 9 years ago
Archive · by Muut Archive, 9 years ago
2 4051 9 years ago
Archive · by Muut Archive, 9 years ago
1 2930 9 years ago
Archive · by Muut Archive, 9 years ago
3 1108 9 years ago