CiviCRM Asked on December 28, 2021
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
.
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 554Warning: 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
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?
Answered by Demerit on December 28, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP