Studio, update advanced search ProjectTask

Problems with updating the Quick and advanced Search of ProjectTask module. The module Project is working fine.

Going to Studio and selecting: Project Tasks -> Layouts -> Filter -> Advanced Filter
I got an error.

With in the logging:

    Mon Jan 13 12:20:31 2020 [17826][25cc0616-aec8-ae79-320d-441c56673bca][FATAL] Exception handling in /srv/www/htdocs/crm/include/MVC/Controller/SugarController.php:400
    Mon Jan 13 12:20:31 2020 [17826][25cc0616-aec8-ae79-320d-441c56673bca][FATAL] Exception in Controller: SearchViewMetaDataParser: advanced_search does not exist for module ProjectTask
    Mon Jan 13 12:20:31 2020 [17826][25cc0616-aec8-ae79-320d-441c56673bca][FATAL] backtrace:
    #0 /srv/www/htdocs/crm/modules/ModuleBuilder/parsers/ParserFactory.php(91): SearchViewMetaDataParser->__construct('advanced_search', 'ProjectTask', NULL)
    #1 /srv/www/htdocs/crm/modules/ModuleBuilder/views/view.searchview.php(84): ParserFactory::getParser('advanced_search', 'ProjectTask', NULL)
    #2 /srv/www/htdocs/crm/include/MVC/View/SugarView.php(226): ViewSearchView->display()
    #3 /srv/www/htdocs/crm/include/MVC/Controller/SugarController.php(435): SugarView->process()
    #4 /srv/www/htdocs/crm/include/MVC/Controller/SugarController.php(375): SugarController->processView()
    #5 /srv/www/htdocs/crm/include/MVC/SugarApplication.php(113): SugarController->execute()
    #6 /srv/www/htdocs/crm/index.php(52): SugarApplication->execute()
    #7 {main}

And the file modules/ProjectTask/metadata/searchdefs.php looks fine. It look like the Project module.

Any idee where start with the problem solving?

 $searchdefs['ProjectTask'] = array(
                    'templateMeta' => array(
                            'maxColumns' => '3',
                            'maxColumnsBasic' => '4',
                            'widths' => array('label' => '10', 'field' => '30'),
                           ),
                    'layout' => array(
                        'basic_search' => array(
                            'name',
                            array('name'=>'current_user_only', 'label'=>'LBL_CURRENT_USER_FILTER', 'type'=>'bool'),

                        ),
                        'advanced_search' => array(
                            'name',
                            array('name' => 'project_name', 'label'=>'LBL_PROJECT_NAME' ),
                            array('name' => 'assigned_user_id', 'type' => 'enum', 'label' => 'LBL_ASSIGNED_TO', 'function' => array('name' => 'get_user_array', 'params' => array(false))),

                        ),
                    ),
               );

Hi @gjongerh,

Welcome back!

I assume you tried running a repair and rebuild, If not give that a go and let me know what happens.
Most likely this not fix anything but worth a try.

What version of SuiteCRM are you using?

Hi Mac-Rae, thanks for your response and attention

Yes, tried running repair and rebuild, unfortunately no results
I used version 7.11.7 and tried to solve the problem with an upgrade to: Version 7.11.10 Sugar Version 6.5.25 (Build 344). Thats the version I use now.

It is rather strange. Any other suggestion?

From the error it seems that $packagename is null here, and it shouldn’t be

Probably something is not set correctly due to the fact that Projecttasks “live” inside Projects.

I don’t know a solution, but maybe you can try something from there like “if module is ProjectTasks, then set $packagename to a correct value”, but don’t ask me what is the “correct value” :man_shrugging: …

The problem was the file ./custom/modules/ProjectTask/metadata/searchdefs.php

<?php
// created: 2020-01-13 11:57:42
$searchdefs['ProjectTask'] = array (
  'templateMeta' => 
  array (
    'maxColumns' => '3',
    'widths' => 
    array (
      'label' => '10',
      'field' => '30',
    ),
    'maxColumnsBasic' => '3',
  ),
  'layout' => 
  array ( ),
);

Changed it to

<?php
// created: 2020-01-13 11:57:42
$searchdefs['ProjectTask'] = array (
  'templateMeta' => 
  array (
    'maxColumns' => '3',
    'widths' => 
    array (
      'label' => '10',
      'field' => '30',
    ),
    'maxColumnsBasic' => '3',
  ),
  'layout' => 
  array (
    'basic_search' =>
    array (),
    'advanced_search' =>
    array ()
  ),
);

Hhmm :thinking: why would you want to set those empty arrays?

This is what is in the core file:

The main reason is that my problem is solved now :slightly_smiling_face:

Making a copy of your file should have been a solution to (i guess) . Would removing the custom file a solution as well??

I guess: when there is a custom file that is used before modules/ProjectTask/metadata/searchdefs.php. The FATAL error is complaining that the arrays are missing. So inserting them makes it work.

Have a nice day.

I guess the real question is: what do you need to customize? If you don’t need any customization you would be better off just removing the file from custom to avoid this kind of bug. If you do need to customize, the trick is to try and change only what is necessary, not the rest.

Yeah completely wright. I did not change anything. I am just using the admin studio.
Don’t understand how this bug is raised, but is solved now. The empty array’s where necessary to make studio work.

Now studio is working, studio has changed the fields I need for searching.

Thanks for your help.

1 Like