Listview empty in custom module. Why?!

I have an absurd problem and Iā€™m exhausted. :frowning:

I have created a custom module called ā€œPropuestasā€ (proposals), it is a module very similar to ā€œDocumentsā€ with many to many relationships with: Accounts, Leads, Targets, etc. (see attached)

The initial idea is, for example, enter in a Lead and in the subpanel add a new Propuesta. This works great. (see attached)

The problem comes when I want to go to the module ā€œPropuestasā€ and see all the proposals. Listview is empty, appears blank.

I canā€™t understand why happens this :blink: HELP PLEASE.

Have you tried the clear button?

If this doesnā€™t fix it try :

Amend include/ListView/ListViewdata.php and add print $main_query; within the function getListViewData().

This will show you the query that is being run which might give you a clue to the issue

1 Like

Thanks for your fast response!

I understand that this file should be amended if I have the error in all listviews. But the problem I only have in the new module created.

I have followed your steps anyway. Thank you very much. But I havenā€™t got results. Iā€™m sure I do something wrong.

First comment (/ * * /) function getListViewData and then write ā€œprint $main_query;ā€ below. And copy the new ListViewdata.php to the same directory.

When I refresh the module the screen is completely blank. If I do rebuild too.

Kind regards.

I got the query with an echo!
SELECT prop1_propuestas.id , prop1_propuestas.modified_user_id , prop1_propuestas.assigned_user_id ,
LTRIM(RTRIM(CONCAT(IFNULL(prop1_propuestas.document_name,ā€™ā€™)))) as name, prop1_propuestas.document_name , prop1_propuestas.date_modified ,
jt0.user_name modified_by_name , jt0.created_by modified_by_name_owner , ā€˜Usersā€™ modified_by_name_mod , jt1.user_name assigned_user_name ,
jt1.created_by assigned_user_name_owner , ā€˜Usersā€™ assigned_user_name_mod, prop1_propuestas.created_by
FROM prop1_propuestas
LEFT JOIN users jt0 ON prop1_propuestas.modified_user_id=jt0.id AND jt0.deleted=0 AND jt0.deleted=0
LEFT JOIN users jt1 ON prop1_propuestas.assigned_user_id=jt1.id AND jt1.deleted=0 AND jt1.deleted=0
WHERE prop1_propuestas.deleted=0
ORDER BY prop1_propuestas.document_name

I hope your comments!

If you run this query in MySql does it give you any results?

1 Like

I donā€™t have access to mysql. I only have access by ftp :S

do you have access to phpMyAdmin?

At the moment we do not have access to the dedicated server. We are working to manage the server soon.

We can only use the ftp and manage suitecrm from the frontend

Regards

Sorry! A user could access to the mysql and this is the result from the query

ERROR 1267 (HY000): Illegal mix of collations (utf8_spanish_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation ā€˜=ā€™

Ok that explains why your list view is empty

you need to alter your table collations so they are consistent

http://stackoverflow.com/questions/11770074/illegal-mix-of-collations-utf8-unicode-ci-implicit-and-utf8-general-ci-implic

1 Like

Amazing! I try it!!

Kind regards!

Solved!

Following the instructions from Mike was very easy.

I only changed the collate utf8 of fields had the problem: assigned_user_id and modified_user_id with an ā€œalter table instructionā€:

ALTER TABLE prop1_propuestas MODIFY assigned_user_id varchar(100) COLLATE utf8_general_ci DEFAULT NULL;

and then the listview works!

Thank you very much!