• Resolved jnorell

    (@jnorell)


    I wanted to try the contact form feature, so I hit the Enable button for it, and got a php error:

    PHP Fatal error: Incorrect module name [contact_form] in /path/to/wp-content/plugins/wpadverts/includes/functions.php on line 32

    I verified this happened consistently, then tested to see if any other features could be enabled, so tried enabling Featured Ads, which seemed fine, and I could disable/enable it repeatedly. I noticed that at that point, Contact Form also showed as enabled (even though it had always given the fatal error when attempting to enable it). I could then disable/enable Contact Form repeatedly, with no errors.

    This is with WP 5.2.2, wpadverts 1.3.4, maps and locations 1.2.0, and custom fields 1.1.0.

    I appear to not be able to reproduce this now, so don’t know that I could help track it down further, but let me know if I can get more info.

    I guess I have an ancillary question, of what should I expect to see if the Contact Form feature is enabled and working? Prior to it being enabled, when viewing an ad, if you click ‘Send Message’ there was a contact form used to contact the seller; after enabling the Contact Form feature, I don’t see any visible changes – is it not working correctly on our site, or am I simply missing something?

    Thanks!

    • This topic was modified 5 years, 8 months ago by jnorell.
    • This topic was modified 5 years, 8 months ago by jnorell.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    thanks for the bug report i will try to replicate it on one of my dev sites, right now i am not really sure what might have caused it.

    To answer your second question, when the contact form is disabled on the Ad details page you should see a “Show Contact Information” button which shows the seller email and phone number.

    When you activate Contact Form, the “Show Contact Information” button should be replaced with “Send Message” button which shows/hides the contact form.

    Thread Starter jnorell

    (@jnorell)

    Ok, I can confirm that behavior for the contact form, thanks. Likely related to the error/issue mentioned here, we apparently already had the Contact Form enabled and working (ie. we had the “Send Message” button with a form), even though the presence of the “Enable” button for the contact form feature implied it was not.

    On a related note, I just disabled the Contact Form feature to test (which worked, “Send Message” changed to “Show Contact Information”), and now I cannot enable it again. Hitting Enable goes to the contact form settings page with a notice that reads, “Module activated successfully.”, but when I hit the “Update Options” button I get the error:

    Notice: Undefined property: Adverts_Flash::$_new in /path/to/wp-content/plugins/wpadverts/includes/class-flash.php on line 150

    and going back to Classifieds > Options shows the Enable button still available (also the front end does not change back to “Send Message” button). No php fatal errors this time, though.

    Plugin Author Greg Winiarski

    (@gwin)

    Hmm i am not really able to replicate it, can you let me know if:

    1. the Contact Form is still deactivated if you enable it and not click “Update Options” in the Contact Form options?

    2. what other modules do you have activated?

    The message Notice: Undefined property: Adverts_Flash::$_new in /path/to/wp-content/plugins/wpadverts/includes/class-flash.php on line 150 is just a notice so most likely it is not causing the problem with module activation.

    Thread Starter jnorell

    (@jnorell)

    Just tested this again and I am not getting any errors/notices/issues, so just ignore it (looks like it is marked resolved, just following up….).

    Plugin Author Greg Winiarski

    (@gwin)

    Ok great, thanks for the follow up, i will keep an eye on it in case it popups again but for now it looks like the issue is resolved.

    Thread Starter jnorell

    (@jnorell)

    I see you just released a new wpadverts with “FIXED: Browser AdBlockers are hiding some inputs in wp-admin / Classifieds / Options / Core panel.” in the changelog, and that makes me think – perhaps this was caused by an ad blocker in my browser? I had come across some other places where it (uBlock Origin) was blocking some assets from loading, and had configured it to allow everything on this dev site between the time that I reported this and when I couldn’t reproduce it. I haven’t tried to undo that and verify, but it is certainly a possibility.

    Plugin Author Greg Winiarski

    (@gwin)

    The AdBlockers can only hide some things on the site or disable JavaScript and styling as they are executed on the rendered site HTML.

    The PHP errors are thrown before the website HTML is sent to the browser, so i do not really think the issue you experienced might be caused by an AdBlocker, but i will see if i can replicate it with uBlock enabled.

    Thread Starter jnorell

    (@jnorell)

    Right, my thoughts were that maybe some javascript was not able to load, so a http request wasn’t sent properly (eg. missing some data) and that lead to triggering the php error when the request was handled. But that’s merely a guess.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘php fatal error enabling contact form feature’ is closed to new replies.