I have a brand new local install of an Acquia Drupal 7 site. When I try using a shortcode, I receive this error:

Warning: function_exists() expects parameter 1 to be string, array given in _shortcode_filter_tips() (line 85 of /Users/sag/Sites/acquia-drupal/sites/all/modules/shortcode/shortcode.module).
Warning: function_exists() expects parameter 1 to be string, array given in _shortcode_filter_tips() (line 85 of /Users/sag/Sites/acquia-drupal/sites/all/modules/shortcode/shortcode.module).
Warning: function_exists() expects parameter 1 to be string, array given in _shortcode_filter_tips() (line 85 of /Users/sag/Sites/acquia-drupal/sites/all/modules/shortcode/shortcode.module).

Please note that there is only one shortcode on the page, but I receive the error three times.

What do I do?

Thank you.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

FareThoughts’s picture

This is absolutely related. As soon as I disabled, the following modules, the above and below errors went away:

  • Shortcode
  • Shortcode Basic Tags
  • Shortcode Embed Content Tag
  • Shortcode Library: Basic Tags
  • Shortcode Video Macro

When I review my Text formats configuration, I'm getting this:

Warning: htmlspecialchars() expects parameter 1 to be string, array given in check_plain() (line 1571 of /Users/sag/Sites/acquia-drupal/includes/bootstrap.inc).
Warning: htmlspecialchars() expects parameter 1 to be string, array given in check_plain() (line 1571 of /Users/sag/Sites/acquia-drupal/includes/bootstrap.inc).
Warning: htmlspecialchars() expects parameter 1 to be string, array given in check_plain() (line 1571 of /Users/sag/Sites/acquia-drupal/includes/bootstrap.inc).
Warning: htmlspecialchars() expects parameter 1 to be string, array given in check_plain() (line 1571 of /Users/sag/Sites/acquia-drupal/includes/bootstrap.inc).
Warning: htmlspecialchars() expects parameter 1 to be string, array given in check_plain() (line 1571 of /Users/sag/Sites/acquia-drupal/includes/bootstrap.inc).
Warning: htmlspecialchars() expects parameter 1 to be string, array given in check_plain() (line 1571 of /Users/sag/Sites/acquia-drupal/includes/bootstrap.inc).

Denes.Szabo’s picture

These errors come from bootstrap with not enabled shortcode modules… Actually I have no clue about what cause this problem, but I think it is not related to the shortcode module.

Denes.Szabo’s picture

Assigned: Unassigned » Denes.Szabo
Status: Active » Postponed (maintainer needs more info)

For the errors you entered in the opening: I can't reproduce them. I tried it but I had not get this error. Actually I worked a bit on the code, mainly in the variable checking. Then next release of the module likely solve your problem.

I set the issue status to postpone. Maybe you can give me more information about how can I reproduce this error (what shortcode, Drupal version, other modules you used etc.).

cmcnamee’s picture

I am also getting these errors. I do not have Acquia Drupal, just the standard Drupal 7 install.

The errors happened as soon as I checked "Shortcodes" checkbox on the Filtered HTML and Full HTML formats and clicked save. Now, the function_exists() error shows on every page of my site that uses shortcodes. And the htmlspecialchars error shows on the text format configurations.

These errors did not happen before enabling "Shortcodes" in the text formats configurations.

Please re-open this issue for debugging if you can. I can provide whatever information you might need, let me know.

cmcnamee’s picture

This is still an issue. But, since I only have a few simple shortcodes to implement, I've developed my own custom module to do so, and have removed the Shortcodes module.

  • Commit f58855c on 7.x-2.x by Denes.Szabo:
    Issue #2067727: Added string check to the callable function name.
    

  • Commit e8e63cf on 7.x-2.x by Denes.Szabo:
    Issue #2067727: Added string and function check before Shortcode...
Denes.Szabo’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Warning: function_exists() expects parameter 1 to be string, array given in _shortcode_filter_tips() (line 85 of /Users/sag/Sites/acquia-drupal/sites/all/modules/shortcode/shortcode.module).

This caused by a wrong Shortcode definition, the filter tip must be callable function not array. Unfortunately we do not know which Shortcodes was enabled…

Error

This error was because there is a bug in the sc_basic_highlight module - the Shortcode callback is missing.

I added double checking the callables into the Shortdoce API module, so, these errors must be disappear now.

I am closing this issue, because I have not received additional usable info as I asked in the #3.

bassam’s picture

This problem happened to me when I had two modules generate some overlapping shortcode names.