Freshly installed Page Title gives me this warning on certain nodes types:

warning: htmlspecialchars() expects parameter 1 to be string, array given in /includes/bootstrap.inc on line 860.

The affected node types are all of the one type and all English language (which is not my default). In original language (Czech) warning is not appearing.

This node is tagged with number of localizable taxonomy terms (which are not always localized), though this could be unrelated with warning?

Please advise me what I can track and test to find culprit.

Comments

Plus’s picture

Category: support » bug

Same bug.

Languages:
Default: Russian without path prefix
Additional: English with path prefix 'en'

PHP 5.3.1, 5.3.3.

Plus’s picture

This is incompatibility issue with i18n submodule 'Taxonomy translation'.

Steps to reproduce:

1. Install Drupal 6.25 (PHP >= 5.2.5)

2. Install modules:
* i18n (Internationalization + Taxonomy translation)
* page_title (Page Title)
* token (Token)

3. Configure 'Page' content type
admin/content/node-type/page
* Workflow settings:
* Multilingual support: Enabled, with translation

4. Add taxonomy vocabulary
admin/content/taxonomy/add/vocabulary
* Translation mode: Localize terms...
* Content types: Page
* Settings: Tags

5. Add some language
admin/settings/language/add
* Russian (for example)

6. Configure
admin/settings/language/configure
* Language negotiation: Path prefix only.

7. Add test page
node/add/page
* title:any, language: English, body: any. Save.

8. Translate test page
node/1/translate
* Russian: ---> [add translation]

Save.

9. Add some tag to the translated page
ru/node/2/edit
* add some tag: tag1
Save.

10. See dblog
admin/reports/dblog
* the bug

Now you can visit ru/node/2 to get the bug in dblog.

Page conditions for the bug:
Language: not default
Tags: 1 or more

abs’s picture

Yes, this is it!

Plus’s picture

It seems setting taxonomy vocabulary's 'Translation mode' (see step 4) to 'Per language terms...' or 'Set language to vocabulary' solves the problem, if using of 'Translation mode: Localize terms' is not obligatory.

vasrush’s picture

This error is fixed for me by applying the patch in the following thread.

http://drupal.org/node/1316786

nicholasthompson’s picture

Status: Active » Needs work

I think I'll need a patch here - you might find luck in #1518348: Warning: htmlspecialchars() expects parameter 1 to be string, array given in check_plain(), but I dont know where this bug is caused in PT...

abs’s picture

Tried patch #1518348 and the error is gone. Everything seems to work fine now.