Some info disappear from interface (but not DB)

Hi everyone,
I am facing a random and very strange problem.

sometimes, some information no longer appears in the interface, but are still present in the database. a few minutes later by refreshing the page, or sometimes by doing a quick repair, everything returns to normal ā€¦

this concerns for example, the field ā€œAssigned Toā€ in Calls, or UserName in the dashlet ā€œMy activity Streamā€

Have you ever seen this? where can the problem come from ?

Thank you very much

SuiteCrm Version 7.11.18

Do you have logic hooks or workflows on these records?

These could be changing things in the back-end, so they donā€™t become visible in the front-end until after the next refresh.

Hi,
Nope. I have logic hooks on lead module (before saver and after save).

Iā€™ve just reproduce few seconds ago.
go to Calls list -> on some items , assignedTo field is empty,
check DB but everything seem ok
refresh list -> same problem
go to home
go to Leads List
go to Calls List -> everything is displayed correctly ā€¦

and now another refresh on Calls List -> assignedTo become empty again ā€¦

I going crazy with this, and my client also :frowning:

Try a few Repairs from Admin -> Repairs. Not just the QR&R, also anything related to Javascript.

Try a different browser.

Check both server logs (suitecrm.log + php_errors.log) and Browser developer console.

yes iā€™ve tried some repairs (QP&R , roles, js etc ) , after that it was correct, but problem appears again few minutes later. i canā€™t do repairs several times a day :frowning:

sometimes this appears on console when displaying Calls List

nothing in php-errors

suitecrm.log on Calls list refresh
Thu Mar 18 11:45:23 2021 [13285][1][DEPRECATED] Array
(
)

Thu Mar 18 11:45:23 2021 [13285][1][WARN] CSS File Dawn/yui.css not found
Thu Mar 18 11:45:24 2021 [13285][1][DEPRECATED] Using row number in fetchByAssoc is not portable and no longer supported. Please fix your code.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Trying to get property of non-object: list view data ā€œorder byā€ is not defined
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Trying to get property of non-object: list view data ā€œsort orderā€ is not defined
Thu Mar 18 11:45:24 2021 [13285][1][DEPRECATED] Using row number in fetchByAssoc is not portable and no longer supported. Please fix your code.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:24 2021 [13285][1][WARN] Undefined data index ID for list view data.
Thu Mar 18 11:45:27 2021 [13416][1][DEPRECATED] Array
(
)

same problem appears on other browser

I donā€™t see any clue that looks particularly promisingā€¦ Iā€™m not sure what you can do next. :man_shrugging:

In your opinion, what are the absolutely necessary elements to create with code a link between a Call and a User for assignment ?

in fact I have an after_save hook, which will define the assignment ($callBean-> assigned_user_id) according to the zip code of the Lead connected to the Call.
i also create a relation between Call and User with :

    $relate_values = array('user_id'=>$call->assigned_user_id,'call_id'=>$call->id);
    $data_values = array('accept_status'=>'none');
    $call->set_relationship($call->rel_users_table, $relate_values, true, true, $data_values);

In the database, the calls.assigned_user_id field is correct and corresponds to the correct user i want, but sometimes this link does not show up on the interface, and Assigne To is empty on list view or edit view. Maybe I forgot a link somewhere?

if not, is it possible that there is a mixture between the sessions (and therefore the rights) of the users ?

Check everything carefully in the database:

  • are the old relationships getting replaced by the new ones, or are they accumulating, so that one record actually has many relationship records for it?

  • could you be having problems due to overgrown tables and slow queries? Suppose that your hook sometimes takes a LONG time to finish. Would that possibly explain the erratic behaviours?

  • maybe itā€™s a caching problem. When you change the relationships in the hook, maybe the front-end is still using an old cached bean and doesnā€™t recognize the change until a bit later. Iā€™m not too sure how this works so youā€™ll have to Google aroundā€¦

thanks (again) , iā€™m googling since two days without any clue :frowning:

itā€™s a ā€œfreshā€ install with less than 100 Calls and Leads ā€¦

iā€™ll look better at ā€œoldā€ relationships. but i donā€™t think because my custom assignation code in hook is launched only on new records ā€¦

and[quote=ā€œpgr, post:10, topic:78941ā€]
are the old relationships getting replaced by the new ones, or are they accumulating, so that one record actually has many relationship records for it
[/quote]

what relationships are you talking about specifically?

for me there is :
calls->assigned_user_id = user->id
calls_users->call_id = call->id and calls_users->user_id = user->id

is there anything else to link a call to a user ?

Any reason why youā€™re using the API? Why not create the relationship normally with Beans?

$bean->load_relationship(ā€˜someRelNameā€™);
$bean->someRelName->add($relatedBean);

No , itā€™s just that i didnā€™t found an another syntax with beans to make it done :-/

see here : How to add a calls_users with code

What about this advice?

i think this 500 error was my fault, iā€™ve tried to save a bean in an before_save hook so I think it was looping on itself
and i had nothing in php_errors

what drives me crazy is that I just dumped the beanā€™s data on edit view, and assigned_user_id value is the right one ā€¦ I donā€™t understand why (sometimes) it doesnā€™t load with Assigned To empty, and other times everything works fine

Capture dā€™eĢcran 2021-03-18 aĢ€ 15.19.25

If I were you, I would really go back to the Bean syntax. That API thing is much more complicated, you have to really understand every nuance of the relationship to get that right - and it seems youā€™re doing something wrong.

I left an answer on the other thread to give you another thing to try with the $bean->rel->add($relBean); syntax.

1 Like

yes iā€™ll try this.

But that did not explain why the assignedTo disappears and reappears without modifying anything ā€¦

In the sugarFeed dashlets, user name causes problem too, sometimes is displayed, sometimes not ā€¦ and it is synchronized with the problem on assignedTo, maybe a problem in the core at user restoring from DB

for example without touching anything except navigating between pages, AssignedTo appears and disappears ā€¦