Dolibarr / dolibarr

Dolibarr ERP CRM is a modern software package to manage your company or foundation's activity (contacts, suppliers, invoices, orders, stocks, agenda, accounting, ...). it's an open source Web application (written in PHP) designed for businesses of any sizes, foundations and freelancers.
https://www.dolibarr.org
GNU General Public License v3.0
5.51k stars 2.81k forks source link

selectForForms: Error bad setup of field objectdescorig=Adherent, objectfield=partnership@partnership:fk_member, objectdesc=Adherent:adherents/class/adherent.class.php:1 #32113

Open fmatias1 opened 3 days ago

fmatias1 commented 3 days ago

Bug

In the new association there is an error when displaying the membership list.

selectForForms: Error bad setup of field objectdescorig=Adherent, objectfield=partnership@partnership:fk_member, objectdesc=Adherent:adherents/class/adherent.class.php:1

I am sending a screenshot to see how it could be corrected.

Captura de pantalla 2024-11-26 a las 20 36 46

Dolibarr Version

20.0.1

Environment PHP

8.2.25

Environment Database

MySQL or MariaDB 10.5.26-MariaDB

Steps to reproduce the behavior and expected behavior

No response

Attached files

No response

ShohruxNizomovv commented 2 days ago

It seems that you're facing an issue related to displaying the membership list in your association due to a bad setup in the field configuration.

The error message you provided:

selectForForms: Error bad setup of field objectdescorig=Adherent, objectfield=partnership@partnership:fk_member, objectdesc=Adherent:adherents/class/adherent.class.php:1

selectForForms: Error bad setup of field objectdescorig=Adherent, objectfield=partnership@partnership:fk_member, objectdesc=Adherent:adherents/class/adherent.class.php:1

indicates that there is an issue with how the Adherent (membership) object and its association with the partnership field are configured.

Here's what you can try to resolve the issue:

  1. Check the association setup:

The field partnership@partnership:fk_member seems to be linking the Adherent object with the partnership field.

Ensure that the fk_member field in the partnership object is correctly defined and is pointing to the correct Adherent class.

Check the object field setup in your database schema or object definitions to ensure the relationships are correctly configured.

  1. Review the adherent.class.php file:

The error mentions adherents/class/adherent.class.php:1, which suggests the issue could be in the Adherent class.

Open the adherent.class.php file and check for any errors or misconfigurations related to fields or object relations. It might be worth reviewing the constructor and methods to ensure the object setup is correct.

  1. Check the field definitions:

Double-check the field definitions in the database and make sure the field types match (e.g., foreign key relationships, field types like integer or varchar).

Ensure that any field values expected to be linked, such as the fk_member, are correctly populated.

  1. Verify the selectForForms function:

If this function is part of a custom setup, check how it is being used in the code and whether it’s interacting with the form and object fields properly.

  1. Testing:

After making changes to the configuration, test by viewing the membership list again and see if the error persists. You can also use debug logs to help identify where the issue is.

If you send the screenshot, I could provide more specific guidance on the issue.