WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7
[resolved] first argument should be either a string or an integer (15 posts)

  1. frankdan
    Member
    Posted 1 year ago #

    Contact Form 7 in Firefox on a mac.

    Is this something to worry about? This appears on every page of the admin side, half-hidden behind the tool bar at the top:

    Warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in /home/domains/thesolitaryangler.com/docs/blog/wp-content/plugins/contact-form-7/includes/capabilities.php on line 14

    Everything seems to be working otherwise...

    Thanks

    http://wordpress.org/extend/plugins/contact-form-7/

  2. Krishna
    Volunteer Moderator
    Posted 1 year ago #

    Apart from what you sated, there is a Bad Value for attribute action on the form. The form is currently corrupt and shows the following syntax:

    <form action="" method="post">

    Form action cannot be empty. It is empty now, because of which mail is not sent out. Additionally, maybe because of excessive and incorrect customizing, HTML validation of your site shows serious errors.

  3. frankdan
    Member
    Posted 1 year ago #

    Any suggestions on how to repair?

    I deleted the form and created another, using the Tag Generator, but there still seems to be trouble.

  4. Krishna K
    Member
    Posted 1 year ago #

    Try re-installing a fresh version of the plugin. Not just deleting the form or your page. I think it should solve your problem.

  5. alve89
    Member
    Posted 1 year ago #

    No, this doesn't solve the Warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in /www/htdocs/w00f5329/wp-content/plugins/contact-form-7/includes/capabilities.php on line 14 problem. Unfortunately.

  6. frankdan
    Member
    Posted 1 year ago #

    Reinstalled the plugin, but still getting weird code appearing in the dashboard (NOT in the actual site) when I activate contact form 7, before creating any forms...

    "Warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in /home/domains/thesolitaryangler.com/docs/blog/wp-content/plugins/contact-form-7/includes/capabilities.php on line 14"

    What other form creation plugins do you recommend?

    Thanks-

  7. alve89
    Member
    Posted 1 year ago #

    There is a plugin called Easyforms, but I think Contact form 7 is much more interactive. So please, dear developers, find the bug and fix it! I'm very satisfied with your plugin!

    The error occurs only on dashboard.

  8. frankdan
    Member
    Posted 1 year ago #

    http://thesolitaryangler.com/images/contactformtrouble.jpg
    http://thesolitaryangler.com/images/contactformtrouble2.jpg

    The same warning appears in the Plugin menu, and under the top tool bar in the Dashboard. Eveything's fine when I deactivate Contact Form 7.

  9. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 1 year ago #

    It has been fixed in the development version. Download it from http://wordpress.org/extend/plugins/contact-form-7/developers/

  10. frankdan
    Member
    Posted 1 year ago #

    Got it - thanks!

    Is it necessary to generate new fields using the Generator, or can I paste in the text from my previous forms?

    Thanks again.

  11. alve89
    Member
    Posted 1 year ago #

    Usually you can copy-paste the previous text.

  12. frankdan
    Member
    Posted 1 year ago #

  13. alve89
    Member
    Posted 1 year ago #

    @Takayuki: I got this error message from my translation-plugin:

    Ladeverhalten: Der Autor benutzt load_textdomain statt load_plugin_textdomain Funktion. Dies kann das Verhalten von WordPress ändern, weil einige Filter und Aktionen nun nicht mehr ausgeführt werden. Bitte kontaktieren Sie den Autor deswegen.

    That means:

    Loading behaviour: The author uses load_textdomain instead of load_plugin_textdomain function. This can change the function of WordPress, because some filters and actions won't be executed anymore. Please contact the author.

    I don't know if this was your intention or not, but I think you should hear that.

    Thanks for fixing the array-bug!

  14. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 1 year ago #

    alve89, you should open a new topic for a new issue, normally. Though, in this case, the message is not correct. Contact Form 7 uses load_textdomain function and does not use it instead of load_plugin_textdomain function. You can ignore the message.

  15. Kloputze
    Member
    Posted 1 year ago #

    replace

    if ( array_key_exists( $cap, $meta_caps ) )
            $caps[] = $meta_caps[$cap];

    with

    if(is_string($cap))
        {
          if ( array_key_exists( $cap, $meta_caps ) )
            $caps[] = $meta_caps[$cap];
        }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic