Author:
buzzomatic
Version:
1.1.1
Released:
11 April 2011
Category:
Field Types

New#1: Setting one side of a bi-link relationship to "required" causes an error

I am using this extension to link attachments to individual entries. A single entry can have multiple attachments, but each attachment can only have one entry. The entry does not require attachments, but each attachment does require an entry.

When I try to add a new attachment from my entry, I get the following error:

strlen() expects parameter 1 to be string, array given
/Users/tonyarnold/Sites/tonyarnold.local/symphony/lib/toolkit/class.field.php line 284

279     }
280
281     public function checkPostFieldData($data, &$message, $entry_id=NULL){
282         $message = NULL;
283         
284         if ($this->get('required') == 'yes' && strlen($data) == 0){
285             $message = __("'%s' is a required field.", array($this->get('label')));
286             
287             return self::__MISSING_FIELDS__;
288         }

Making the entry not required for the attachment gets past this error, but is obviously not the behaviour I want.

Hopefully this makes sense, but let me know if it doesn’t or you need more info!

Please login 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