Search

This seems like it should be easy to fix, but I don't understand: when I check "Include a count of entries in associated sections" for a pretty basic data source, the data source outputs an error: mysqli_real_escape_string() expects parameter 2 to be string, array given on 413 of file /MAMP/gng/symphony/lib/toolkit/class.mysql.php.

Any tips on how to correct such a problem? What additional details can I give to help elucidate a solution?

Which Symphony version is it? Can you provide a simplified test case—how to set up two sections and a data source in order to replicate the issue?

Upon further investigation, it looks like a tag list field is causing the problem. When I choose not to include the tag list in xml output, I don't receive any errors.

I've just created a secondary data source (without tags output) to pull the counts I need.

It's a bit of a head-scratcher. I'm in a rush to get this project finished, so this will have to work for now. Thanks for your willingness to help!

Nigel, which version of Symphony is causing this issue for you? I've just tried a quick test on a 2.6.1 installation and I'm unable to reproduce the error. If you can give a little more insight into the section setup I can take another look for you!

I was running 2.6.0, but I just upgraded to 2.6.1 and the error persists!

However, I made some headway towards finding the problem. Read on...

I'll try to provide some details about the site structure. It's the most complex thing I've ever done in Symphony, but, generally speaking: I have a section called "Units", where each entry is a distinct curriculum unit with title, description, tags, and a few other fields. I have a second section, "Lessons", whose entries represent individual lessons associated with a single entry in Units. One Units entry may have five or six Lessons entries associated with it.

I have numerous other sections as well, five of which also have "tags" fields. The "suggestion list" for each of these tags fields references "existing values" plus the "tags" fields in the four other sections. So—for example—my Units section's tags field pulls suggestions from existing values plus tag fields in sections "Leaders", "News", "Videos", and "Student research".

The data source in question pulls basic information from "Units"—until now, when "Include a count of entries in associated sections" is selected, the data source gives an error. However: when I modify the "suggestion list" for the Units section's tags field—when I remove references to the other sections' tag fields—the data source functions as expected. Go figure.

So the problem must lie in the way I've configured the suggestion list for the tags field. Can you explain that to me? Am I expecting the tags field to do more than it is able to do?

Thanks for your help!

I'm not as familiar with the code base, my gut feeling would be that it's getting confused because the tag field is being used to populate from existing choices + from other fields. This is being considered a kind of a relationship. Maybe there's a bug there, possibly trying to add up existing values as count of associated entries...

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details