Author:
ahwayakchih
Version:
1.2.2
Released:
11 July 2012
Category:
Field Types, Workflow, and Other

Closed#1: Wrong parameter count for str_replace()

I’m running 2.0.8RC1, and when I add the Filter: Field to a section, and then when I go to save my entry, I get the following Symphony Warning / Error

Wrong parameter count for str_replace()
An error occurred in /home/user/public_html/extensions/filterfield/fields/field.filter.php around line 166
161:                         if (is_array($v)) {
162:                             $v = implode(', ', $v);
163:                         }
164:                         $expression = str_replace($m[0], $v);
165:                     }
166:                     else $expression = str_replace($m[0], '');
167:                 }
168:             }
169:
170:             $message = NULL;
Backtrace:
[:0] GenericErrorHandler::handler();
[/home/user/public_html/extensions/filterfield/fields/field.filter.php:166] str_replace();
[/home/user/public_html/symphony/lib/toolkit/class.entry.php:92] fieldFilter->checkPostFieldData();
[/home/user/public_html/symphony/content/content.publish.php:773] Entry->checkPostData();
[/home/user/public_html/symphony/content/content.publish.php:29] contentPublish->__actionEdit();
[/home/user/public_html/symphony/content/content.publish.php:38] contentPublish->__switchboard();
[/home/user/public_html/symphony/lib/toolkit/class.administrationpage.php:70] contentPublish->action();
[/home/user/public_html/symphony/lib/core/class.administration.php:88] AdministrationPage->build();
[/home/user/public_html/symphony/lib/core/class.administration.php:204] Administration->__buildPage();
[/home/user/public_html/index.php:20] Administration->display();

Have you run across this? Could you give me pointers on how I can get this fixed?

This issue can be closed. I was using the extension incorrectly. I was putting the expression in the Prevent publishing if expression below evaluates to false area of the field when I was adding it to my section. That was my problem. I left that field blank and checked Allow datasources to filter this section with expression. Then when I went to my datasource for that section, I filtered the datasource on that field.

That was my problem! Sorry for the wild goose chase! Thank you again!

It was a bug, but in part of code that shouldn't be used yet.

My fault because I should have make that option hidden before publishing this extension.

Thanks for report :).

This issue is closed.

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