2
  1. I'm sending a .ods file name into the makeFileName method to get a unique string value for the file name. but it return a file name which is not ending in .ods instead it end with .unknown.

    Ex: template_ods_65c986571c9c2737fff370ce4a745015.unknown

    but i need a file name like template_65c986571c9c2737fff370ce4a745015.ods.

  2. Other thing is when i assign a returned string value into a variable, it gives me the array to string conversion error. code

    $newName = CRM_Utils_File::makeFileName($value['name']);

    Error

Array to string conversion in /var/www/html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php on line 554

Warning: htmlspecialchars() expects parameter 1 to be string, array given in /var/www/html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php on line 556

I confused with these two error, i'll appreciate if someone could help me to resolve it

1 Answer 1

1

For the first question you can go to Administer - System Settings - Safe File Extensions and add .ods to the list there.

For the second one is $value['name'] actually a string or is it an array?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.