Problems with dropdowns specifically case_status_dom

Tested on an existing setup and fresh install. I must be missing something. If I edit case_status_dom list and change any of the values or add additional to it. After clicking save and refreshing detailed view or edit view the dynamic dropdown becomes empty you cannot click anything. Same with case_state_dom. Was there a change going from Sugar to Suitecrm. Existing setup was upgraded to suitecrm. Fresh install used was latest Suitecrm.

Hi, welcome.

How exactly are you editing case_status_dom, are you using Dropdown editor or changing some files? You say you’re coming from Sugar, so are trying to use any custom file from there?

Do you see any errors in your logs?

Fresh install does it too. I have tryed different ways through editing files and through studio or dropdown editor all result with empty dropdown.

I will view the logs on a fresh setup. The existing crm we have is huge so logs move way too quick. Too much information.

It’s not permissions either because I replicated this on Linux and Windows.

With default you get new, pending input, assigned. However case_status_dom has new, assigned, pending input, rejected and closed. If I edit the list then ref esh page dropdown disappears like it breaks.

Why do I need to edit defaults? So it matches our needs.

I tried creating a fresh status I.e case_status_new and parent dropdown state. Attached that to edit and detail view. But when changing status to close and clicking save. in sql state changed to close but status was still new so case never disappeared from dash.

Will read logs today. Can’t be this hard.

It makes sense that a new status field doesn’t integrate with the existing code. The existing logic works with the existing field.

So we need to make sure you can edit the existing case_status_dom and it works. I wonder if there is a bug there. Which version are you running?

Can you try this on the live demo to see if the behaviour is the same there?

https://www.softaculous.com/demos/SuiteCRM

Logging in now won’t take me long. I decided to upgrade to the latest. Now i’m thinking maybe I should of chosen a LTS or something.

I modified the list, Went to Cases, Click create, refreshed the page and only have 4 options, Closed, Rejected etc disappeared.

Anyway with our current setup as status has destroyed itself, somehow the status, state of cases on the detailedview screen is now blank and I haven’t found a way to fix it. Logs do not show anything to give me hints. I only see PHP notices of undefined values, variables. I cannot edit case descriptions either, I click save, go back in the case and it has the last result.

I’m going to compare the first time I upgraded file/dir with another version few days after.

I tried doing repair etc, things are not working right.

When you have multiple problems, and see “undefineds” across the application, this is normally caused by Linux permission issues. Sometimes it’s the cron jobs that are running as root and break your permissions continuously, even after you reset permissions.

Running CentOS 6.10.
User root, Group Apache for my web dir.

config.php ==>

‘default_permissions’ =>
array (
‘dir_mode’ => 1528,
‘file_mode’ => 493,
‘user’ => ‘root’,
‘group’ => ‘apache’,
),

array (
‘max_cron_jobs’ => 10,
‘max_cron_runtime’ => 30,
‘min_cron_interval’ => 30,
‘allowed_cron_users’ =>
array (
0 => ‘apache’,
1 => ‘root’,
),
),

crontab ==> This has been like this since Sugar days!

          • cd /var/www/vhost_sugarcrm/web; php -f cron.php > /dev/null 2>&1

Most permissions configurations “from Sugar days” were very wrong (even if they worked).

It is highly recommended that nothing runs as root.

You need to determine your web server user name. Try this:

ps -ef | egrep '(httpd|apache2|apache)' | grep -v `whoami` | grep -v root | head -n1 | awk '{print $1}'

Now, move that crontab entry from the root’s crontab into that user’s crontab.

Background reading: https://pgorod.github.io/Scheduler-Jobs/

Now set the SuiteCRM permissions as described in the installation guide, using your web server user name instead of www-data (if it is different)

  sudo chown -R www-data:www-data .
  sudo chmod -R 755 .
  sudo chmod -R 775 cache custom modules themes data upload
  sudo chmod 775 config_override.php 2>/dev/null

Change your config.php to remove root.

Quick repair and rebuild.

User apache for the httpd process.

I have hashed out cron for root and added cron for apache.

I chowned web dir for apache.apache, I re-set permissions. I changed config to remove root. I did a repair and rebuild.

I get stuff in logs like the below:
PHP Notice: Undefined index: preview in /var/www/vhost_sugarcrm/web/download.php

I goto a case, status is blank on DetailView and broken on EditView.

I click Edit, Modify the description, Click save and it doesn’t save what I type. TinyMCE is messed up too.
I get this error straight after I click save =>

Thu Aug 23 21:27:43 2018 [1767][1][ERROR] Unsupported segments file format

And thank you for helping me much appreciated.

These are all significant steps forward. I am hoping some of your current issues are just left-overs from the past, and as caches invalidate and renew they might improve.

The Segments error is related to AOD_Index which always corrupts when permissions are wrong. See https://pgorod.github.io/Reindex-AOD/

You can also delete “cache/themes” directory from your server, it will get recreated.

How does your config.php default_permissions look now?

config.php =>

‘default_permissions’ =>
array (
‘dir_mode’ => 1528,
‘file_mode’ => 493,
‘user’ => ‘apache’,
‘group’ => ‘apache’,
),

I have moved the AOD Index/Index folder and truncated both aod_index and aod_indexevent tables.

Would AOD Index being corrupt stop status and state showing on the detailedview pages? And would AOD Index also stop me modifying the cases description and trying to save stuff?

Admin case_status_dom
https://imgur.com/a/Rk43Xf6

EditView case_status_dom
https://imgur.com/a/EKwPrPE

DetailView case_status_dom field blank
https://imgur.com/a/ZLxj7AC

So my current issues are:

1/ If I change values in case_status_dom I can easily break it or most of the menu disappears. I lose Closed then I cannot close cases.
2/ Blank status field on DetailView page. Resetting view, re-adding case_status_dom to editview and sync to detailview still doesn’t fix it.
3/ Cannot edit Description under Cases. Existing cases or Create new.
4/ TinyMCE editor not displaying right on Case pages.

3/ Existing or new cases, cannot add anything to the description field, doesn’t save.
New cases get imported via email. Checked field description is in database, new emails fill all required info to fields i.e status, description etc.
So saving to the database shouldn’t be a problem.

The AOD issues should be independent of the others.

About the case_status_dom, note that that is a dependent dropbox, it needs it’s sibling case_state_dom which has values “open” and “closed”. These will narrow down the options on the second box. You will only see the status options starting with “closed_” when the state is “closed”.

Background reading:
https://suitecrm.com/suitecrm/forum/suitecrm-7-0-discussion/19487-how-to-create-an-associated-dropdown

I fully understand this. If case is Open it will see Open_xxxx and if case closed it will see Closed_xxxx I can fix all this.

So if I go through the cases database and fix the case status and state fields to reflect this pattern I’m guessing my edit view and detailview status, state will be fixed.

So then that leaves me with description field not allowing me to save. I can make changes to calls, leads, opportunity description field. But case description field won’t save anything.

Thank you, I have managed to fix the existing New status cases and old status cases by having New and Open_New, Closed and Closed_Closed in the case_status_dom instead of going through the database and updating the status and state fields. So this in return has fixed both DetailView status and EditView status fields and dropdowns.

So inside a case, when you update the description and click save what hook gets activated here? Logic Hook?

Query UPDATE???

Trying to find out why it’s not saving.

UPDATE cases_cstm SET …
WHERE is the UPDATE cases SET query???

I have tested this on our existing upgraded version and on a fresh install.

Click Edit case, add description, Click save. No Query in logs.

I went another direction from the detailed view page, double click Description field, add something then Click the tick symbol. It saves. Successful on fresh install. Fails on existing setup.

Only get logs when trying via DetailedView page of case. It does the below queries 3 times in a row. Edit box for description shows then quickly disappears.

Retrieve Case : SELECT cases.*,cases_cstm.* FROM cases  LEFT JOIN cases_cstm ON cases.id = cases_cstm.id_c  WHERE cases.id = '20921cda-4ab5-a16a-fdcf-5b7f4ef680ba' AND cases.deleted=0
Limit Query:SELECT cases.*,cases_cstm.* FROM cases  LEFT JOIN cases_cstm ON cases.id = cases_cstm.id_c  WHERE cases.id = '20921cda-4ab5-a16a-fdcf-5b7f4ef680ba' AND cases.deleted=0 Start: 0 count: 1
Query:SELECT cases.*,cases_cstm.* FROM cases  LEFT JOIN cases_cstm ON cases.id = cases_cstm.id_c  WHERE cases.id = '20921cda-4ab5-a16a-fdcf-5b7f4ef680ba' AND cases.deleted=0 LIMIT 0,1
Query:SELECT acc.id, acc.name FROM accounts  acc, cases  WHERE acc.id = cases.account_id AND cases.id = '20921cda-4ab5-a16a-fdcf-5b7f4ef680ba' AND cases.deleted=0 AND acc.deleted=0

On a fresh install: Doesn’t loop the queries as much, I can see roughly two times below. This is when double clicking the description field from the DetailedView page.

Query:SELECT cases.*,cases_cstm.* FROM cases  LEFT JOIN cases_cstm ON cases.id = cases_cstm.id_c  WHERE cases.id = '10c9483a-b615-d384-5ccd-5b7f54ab0069' AND cases.deleted=0 LIMIT 0,1
Query:SELECT acc.id, acc.name FROM accounts  acc, cases  WHERE acc.id = cases.account_id AND cases.id = '10c9483a-b615-d384-5ccd-5b7f54ab0069' AND cases.deleted=0 AND acc.deleted=0
Retrieve Case : SELECT cases.*,cases_cstm.* FROM cases  LEFT JOIN cases_cstm ON cases.id = cases_cstm.id_c  WHERE cases.id = '10c9483a-b615-d384-5ccd-5b7f54ab0069' AND cases.deleted=0
Limit Query:SELECT cases.*,cases_cstm.* FROM cases  LEFT JOIN cases_cstm ON cases.id = cases_cstm.id_c  WHERE cases.id = '10c9483a-b615-d384-5ccd-5b7f54ab0069' AND cases.deleted=0 Start: 0 count: 1
Query:SELECT cases.*,cases_cstm.* FROM cases  LEFT JOIN cases_cstm ON cases.id = cases_cstm.id_c  WHERE cases.id = '10c9483a-b615-d384-5ccd-5b7f54ab0069' AND cases.deleted=0 LIMIT 0,1
Query:SELECT acc.id, acc.name FROM accounts  acc, cases  WHERE acc.id = cases.account_id AND cases.id = '10c9483a-b615-d384-5ccd-5b7f54ab0069' AND cases.deleted=0 AND acc.deleted=0

if I Click Edit Case, add description, Click save I get the below queries: It doesn’t save of course.

Thu Aug 23 18:21:36 2018 [5108][1][DEBUG] process_full_list: AOD_IndexEvent(a2aba91f-19af-6aa1-8881-5b7f576503de): record_id = 10c9483a-b615-d384-5ccd-5b7f54ab0069
                                        SET `name`='Having trouble adding new items',`date_modified`='2018-08-24 01:21:36',`modified_user_id`='1',`created_by`='1',`description`=NULL,`assigned_user_id`='',`error`=NULL,`success`=1,`record_id`='10c9483a-b615-d384-5ccd-5b7f54ab0069',`record_module`='Cases'
Thu Aug 23 18:21:36 2018 [5108][1][DEBUG] Retrieve Case : SELECT cases.*,cases_cstm.* FROM cases  LEFT JOIN cases_cstm ON cases.id = cases_cstm.id_c  WHERE cases.id = '10c9483a-b615-d384-5ccd-5b7f54ab0069' AND cases.deleted=0
Thu Aug 23 18:21:36 2018 [5108][1][DEBUG] Limit Query:SELECT cases.*,cases_cstm.* FROM cases  LEFT JOIN cases_cstm ON cases.id = cases_cstm.id_c  WHERE cases.id = '10c9483a-b615-d384-5ccd-5b7f54ab0069' AND cases.deleted=0 Start: 0 count: 1
Thu Aug 23 18:21:36 2018 [5108][1][INFO] Query:SELECT cases.*,cases_cstm.* FROM cases  LEFT JOIN cases_cstm ON cases.id = cases_cstm.id_c  WHERE cases.id = '10c9483a-b615-d384-5ccd-5b7f54ab0069' AND cases.deleted=0 LIMIT 0,1
Thu Aug 23 18:21:36 2018 [5108][1][INFO] Query:SELECT acc.id, acc.name FROM accounts  acc, cases  WHERE acc.id = cases.account_id AND cases.id = '10c9483a-b615-d384-5ccd-5b7f54ab0069' AND cases.deleted=0 AND acc.deleted=0
Thu Aug 23 18:21:36 2018 [5108][1][INFO] Query:INSERT INTO tracker (monitor_id,user_id,module_name,item_id,item_summary,date_modified,action,session_id,visible ) VALUES ( '8e3e82fd-585e-b8df-68c8-5b7f5db92d67','1','Cases','10c9483a-b615-d384-5ccd-5b7f54ab0069','Having trouble adding new items','2018-08-24 01:21:36','detailview','pq8vne5pl7sphrn097o0qgaimk','1')
Thu Aug 23 18:21:37 2018 [5108][1][INFO] Query:SELECT id FROM notes WHERE notes.parent_id = '10c9483a-b615-d384-5ccd-5b7f54ab0069' AND notes.deleted=0 AND notes.parent_type = 'Cases'
Thu Aug 23 18:21:37 2018 [5108][1][INFO] Query:SELECT id FROM aop_case_updates WHERE aop_case_updates.case_id = '10c9483a-b615-d384-5ccd-5b7f54ab0069' AND aop_case_updates.deleted=0
Thu Aug 23 18:21:38 2018 [5108][1][INFO] Get One: |SELECT id FROM favorites WHERE parent_id= '10c9483a-b615-d384-5ccd-5b7f54ab0069' AND parent_type = 'Cases' AND assigned_user_id = '1' AND deleted = 0 ORDER BY date_entered DESC|
Thu Aug 23 18:21:38 2018 [5108][1][DEBUG] Limit Query:SELECT id FROM favorites WHERE parent_id= '10c9483a-b615-d384-5ccd-5b7f54ab0069' AND parent_type = 'Cases' AND assigned_user_id = '1' AND deleted = 0 ORDER BY date_entered DESC Start: 0 count: 1
Thu Aug 23 18:21:38 2018 [5108][1][INFO] Query:SELECT id FROM favorites WHERE parent_id= '10c9483a-b615-d384-5ccd-5b7f54ab0069' AND parent_type = 'Cases' AND assigned_user_id = '1' AND deleted = 0 ORDER BY date_entered DESC LIMIT 0,1

LTS fresh install 7.8.20 doesn’t save a cases description either. Not via EditView anyway.

Here’s log snippet:

Thu Aug 23 19:25:42 2018 [5108][1][DEBUG] process_full_list: AOD_IndexEvent(5fb775c2-54a7-d11b-c3dc-5b7f6ccc9065): record_id = 10dd554e-150b-ee4e-3ae1-5b7f6998f21e
                                        SET `name`='Need to purchase additional licenses',`date_modified`='2018-08-24 02:25:42',`modified_user_id`='1',`created_by`='1',`[b]description`=NULL[/b],`assigned_user_id`='',`error`=NULL,`success`=1,`record_id`='10dd554e-150b-ee4e-3ae1-5b7f6998f21e',`record_module`='Cases'

OK Here’s 2nd go:

Via editview:
I typed in 1 2 3 so should of been Jonish 1 2 3


Thu Aug 23 19:41:46 2018 [5108][1][INFO] Query:UPDATE cases_cstm SET  jjwg_maps_address_c='' ,jjwg_maps_geocode_status_c='' ,jjwg_maps_lat_c=NULL ,jjwg_maps_lng_c=NULL WHERE id_c='10dd554e-150b-ee4e-3ae1-5b7f6998f21e'
                                        SET `name`='Need to purchase additional licenses',`date_modified`='2018-08-24 02:41:45',`modified_user_id`='1',`created_by`='1',`description`='<p>Jonish</p>',`assigned_user_id`='seed_max_id',`type`='Administration',`status`='Open_Pending Input',`priority`='P3',`resolution`=NULL,`work_log`=NULL,`account_id`='6527046b-d5ba-50bf-fb55-5b7f69c2f6a6',`state`='Open',`contact_created_by_id`=''
                                        SET `name`='Need to purchase additional licenses',`date_modified`='2018-08-24 02:41:46',`modified_user_id`='1',`created_by`='1',[b]`description`=NULL[/b],`assigned_user_id`='',`error`=NULL,`success`=1,`record_id`='10dd554e-150b-ee4e-3ae1-5b7f6998f21e',`record_module`='Cases'

Via detailview:
Wierd when I double click the field it kept disappearing but eventually got it. It has the

tags around it too which normally doesn’t happen.

Jonish



Thu Aug 23 19:46:20 2018 [5108][1][INFO] Query:UPDATE cases_cstm SET  jjwg_maps_address_c='' ,jjwg_maps_geocode_status_c='' ,jjwg_maps_lat_c=NULL ,jjwg_maps_lng_c=NULL WHERE id_c='10dd554e-150b-ee4e-3ae1-5b7f6998f21e'
                                        SET `name`='Need to purchase additional licenses',`date_modified`='2018-08-24 02:46:20',`modified_user_id`='1',`created_by`='1',`[b]description`='Jonish 1 2 3[/b]',`assigned_user_id`='seed_max_id',`type`='Administration',`status`='Open_Pending Input',`priority`='P3',`resolution`=NULL,`work_log`=NULL,`account_id`='6527046b-d5ba-50bf-fb55-5b7f69c2f6a6',`state`='Open',`contact_created_by_id`=''
                                        SET `name`='Need to purchase additional licenses',`date_modified`='2018-08-24 02:46:20',`modified_user_id`='1',`created_by`='1',`[b]description`=NULL[/b],`assigned_user_id`='',`error`=NULL,`success`=1,`record_id`='10dd554e-150b-ee4e-3ae1-5b7f6998f21e',`record_module`='Cases'

I should have bolded the Description outside of the code tags, sorry.