Call to undefined function minify_css()

Dear Friends,

I had made a subpanel ‘Target Lists’ to appear in detail view or edit view of ‘Contacts’ module. It was working fine since a long time.

When we click on ‘Create/Select’ button here, we get:

Fatal error:  Uncaught Error: Call to undefined function minify_css() in /home2/luminisi/public_html/SuiteCRM/include/Smarty/plugins/block.minify.php:15
Stack trace:
#0 [internal function]: {closure}(Array)
#1 /home2/luminisi/public_html/SuiteCRM/include/Smarty/plugins/block.minify.php(16): preg_replace_callback('#<([^<]+?)\\s+st...', Object(Closure), '<label for="dom...')
#2 /home2/luminisi/public_html/SuiteCRM/cache/smarty/templates_c/%%55^553^5539A9C5%%form_QuickCreate_ProspectLists.tpl.php(625): smarty_block_minify(Array, '<label for="dom...', Object(Sugar_Smarty), false)
#3 /home2/luminisi/public_html/SuiteCRM/include/Smarty/Smarty.class.php(1264): include('/home2/luminisi...')
#4 /home2/luminisi/public_html/SuiteCRM/include/Sugar_Smarty.php(151): Smarty->fetch('cache/themes/Su...', NULL, NULL, false)
#5 /home2/luminisi/public_html/SuiteCRM/include/TemplateHandler/TemplateHandler.php(365): Sugar_Smarty->fetch('cache/themes/Su...')
#6 /home2/luminisi/public_html/SuiteCRM/include/EditView/EditView2.php(909): TemplateHan in /home2/luminisi/public_html/SuiteCRM/include/Smarty/plugins/block.minify.php on line 15

And suitecrm.log shows some FATAL errors:

Sat May  5 06:49:59 2018 [430708][1][FATAL] SugarBean::populateDefaultValues $field_defs should be an array
Sat May  5 07:12:19 2018 [559721][1][FATAL] SugarBean::populateDefaultValues $field_defs should be an array
Sat May  5 07:20:17 2018 [609936][1][FATAL] SugarBean::populateDefaultValues $field_defs should be an array
Sat May  5 08:38:41 2018 [1003050][1][FATAL] ERROR: rmdir_recursive(): argument cache/themes/SuiteP/modules is not a file or a dir.
Sat May  5 08:39:31 2018 [1006769][1][FATAL] SugarBean::populateDefaultValues $field_defs should be an array

Could you please guide about how to solve it.

With thanks,

RK

Please always include your SuiteCRM version when posting. I sometimes answer more than 50 posts in a day, there is no way I can keep track of everyone.

I’ve seen that “[FATAL] SugarBean::populateDefaultValues $field_defs should be an array” and I believe that it has already been fixed in 7.10.4 (although maybe it’s just in 7.10.5 which is about to be released?).

How did you make the subpanel, through Studio or code? Have you tried several repairs from Admin / Repair, including all that are javascript related?

Dear PGR,

It is latest one SuiteCRM 7.10.4.

I tried with only Quick Repair & Rebuild, after deleting the cache folder in suitecrm folder of the website.

Kindly guide me ahead!

With thanks,

RK

I asked this because I was wondering if you could try doing the subpanel again, that might fix something that got broken.

Try the other repairs!

And do you see any errors in php_errors.log?

Dear pgr,

I had created these subpanel 2-3 years back via coding. I have last backup of SuiteCRM on my development machine (WAMP) and the version is 7.5.4. I have just checked the same subpanel is working fine there.

On date: 2-May-2018, I have upgraded to the latest version, as no upgrade was done in last 1.5 years approx. The subpanel on live website is throwing these errors.

For the time being, I am trying to get my hand on php error logs, if I could.

I am not sure where is the problem, as of now.

With thanks,

RK

Dear Friends,

I at least got to know why the same subpanel of ‘Target List’ was working in SuiteCRM v.7.9.5, is that there was no block.minify.php in smarty plugins before. It is there simply because of recent upgradation(s).

The error message appears when I click on button ‘Create’ or ‘Select’ of Target List subpanel:

I have already all repairs.

Kindly help me solve the problem, otherwise I would have not option but to revert back to SuiteCRM v.7.9.5.

Help is needed.

With thanks,

RK

Dear Friends,

It is solved.

Solution was to change the line 15 in block.minify.php to:

 return '<' . $matches[1] . ' style=' . $matches[2] . $matches[3] . $matches[2];

Thanks,

RK

I’m glad you solved it!

… but: I am a bit confused. Is this a bug we should solve in SuiteCRM? Or just a problem in your own server?

Dear Pgr,

It definitely looks like some sort of coding leftover in file: block.minify.php. This file is a recent inclusion in SuiteCRM/include/Smarty/plugins/. Only the developer of this file could confirm – whether it is a minor bug or essential piece of code. However, as of now minify_css() is surely an undefined function.

Kindly instruct about the icon-related problem as exhibited:

With thanks,

RK

Ok, nice catch.

Can you please open an Issue on GitHub with this? Thanks for reporting!

Dear pgr,

Opened an issue:

https://github.com/salesagility/SuiteCRM/issues/5832

Can you tell me about studio icons problems as were shown in previous posts?

With thanks,

RK

1 Like

Thanks for the issue. It seems there’s a fix already!

You have missing icons in Studio, in version 9.10.4, but I don’t know what version 9.10.4 is…

Sorry it is SuiteCRM v7.10.4

About the icons, I think it’s related to this change, I will post there asking about this

https://github.com/salesagility/SuiteCRM/pull/5517

It is solved with the hotfix suggested by Dillon-Brown at 5832

Thanks to all!

RK