sugarcrm-developers / school

Professor M's School for Gifted Coders
Apache License 2.0
20 stars 19 forks source link

Prof M not compatible with Oracle db #81

Closed lschaefer-sugarcrm closed 6 years ago

lschaefer-sugarcrm commented 6 years ago

Reported internally by Rajesh Badhe:

Prof M package - https://github.com/sugarcrm/school/releases/tag/20180607-14.38.22-6758975

Step 1: Install Sugar without demo data. Step 2: Install Prof M package. Step 3: try creating Student or running postman collection from Prof M page.

Result - 500 Error indicating 'ORA-00904: "CONTACTS_CSTM"."FLOWERS_SENT_C": invalid identifier'. Expectation - Student created successfully.

Here is error stack - HTTP: 500 Internal Server Error An exception occurred while executing 'SELECT a.* FROM (SELECT contacts.id, contacts.date_modified, contacts.assigned_user_id, contacts.created_by, contacts.salutation, contacts.first_name, contacts.last_name, contacts.date_entered, contacts.modified_user_id, jt0_modified_user_link.first_name rel_modifi1aa9_first_name, jt0_modified_user_link.last_name rel_modified_by_name_last_name, jt0_modified_user_link.created_by modified_by_name_owner, jt1_created_by_link.first_name rel_created_by_name_first_name, jt1_created_by_link.last_name rel_created_by_name_last_name, jt1_created_by_link.created_by created_by_name_owner, contacts.description, contacts.deleted, contacts.title, contacts.facebook, contacts.twitter, contacts.googleplus, contacts.department, contacts.do_not_call, contacts.phone_home, contacts.phone_mobile, contacts.phone_work, contacts.phone_other, contacts.phone_fax, contacts.primary_address_street, contacts.primary_address_city, contacts.primary_address_state, contacts.primary_address_postalcode, contacts.primary_address_country, contacts.alt_address_street, contacts.alt_address_city, contacts.alt_address_state, contacts.alt_address_postalcode, contacts.alt_address_country, contacts.assistant, contacts.assistant_phone, contacts.picture, contacts.lead_source, jt2_accounts.id account_id, jt2_accounts.assigned_user_id account_id_owner, jt2_accounts.name account_name, jt2_accounts.assigned_user_id account_name_owner, contacts.dnb_principal_id, contacts.reports_to_id, jt3_reports_to_link.salutation rel_report_to_name_salutation, jt3_reports_to_link.first_name rel_report_to_name_first_name, jt3_reports_to_link.last_name rel_report_to_name_last_name, jt3_reports_to_link.assigned_user_id report_to_name_owner, contacts.birthdate, contacts.portal_name, contacts.portal_active, contacts.portal_password, contacts.portal_app, contacts.preferred_language, contacts.dp_business_purpose, contacts.dp_consent_last_updated, contacts.campaign_id, jt4_campaign_contacts.name campaign_name, jt4_campaign_contacts.assigned_user_id campaign_name_owner, case when jt5_user_sync.id IS NOT NULL then 1 else 0 end sync_contact, contacts.mkto_sync, contacts.mkto_id, contacts.mkto_lead_score, case when jt6_following_link.id IS NOT NULL then 1 else 0 end following, case when jt7_favorite_link.id IS NOT NULL then 1 else 0 end my_favorite, jt8_locked_fields_link.pro_locked_variables locked_fields, jt8_locked_fields_link.assigned_user_id locked_fields_owner, jt9_assigned_user_link.first_name rel_assign9cd2_first_name, jt9_assigned_user_link.last_name rel_assignf258e_last_name, jt9_assigned_user_link.created_by assigned_user_name_owner, contacts.team_id, contacts.team_set_id, contacts.acl_team_set_id, jt10_team_count_link.created_by team_count_owner, jt11_email_addresses_primary.email_address email1, jt11_email_addresses_primary.invalid_email, jt11_email_addresses_primary.opt_out email_opt_out, contacts_cstm.alias_c, contacts_cstm.status_c, contacts_cstm.vitals_c, contacts_cstm.cause_of_death_c, contacts_cstm.flowers_sent_c FROM contacts LEFT JOIN users jt0_modified_user_link ON (contacts.modified_user_id = jt0_modified_user_link.id) AND (jt0_modified_user_link.deleted = ?) LEFT JOIN users jt1_created_by_link ON (contacts.created_by = jt1_created_by_link.id) AND (jt1_created_by_link.deleted = ?) LEFT JOIN accounts_contacts accounts_contacts ON (contacts.id = accounts_contacts.contact_id) AND (accounts_contacts.deleted = ?) AND (accounts_contacts.primary_account = ?) LEFT JOIN accounts jt2_accounts ON (jt2_accounts.id = accounts_contacts.account_id) AND (jt2_accounts.deleted = ?) LEFT JOIN accounts_cstm jt2_accounts_cstm ON jt2_accounts_cstm.id_c = jt2_accounts.id LEFT JOIN contacts jt3_reports_to_link ON (contacts.reports_to_id = jt3_reports_to_link.id) AND (jt3_reports_to_link.deleted = ?) LEFT JOIN contacts_cstm jt3_reports_to_link_cstm ON jt3_reports_to_link_cstm.id_c = jt3_reports_to_link.id LEFT JOIN campaigns jt4_campaign_contacts ON (contacts.campaign_id = jt4_campaign_contacts.id) AND (jt4_campaign_contacts.deleted = ?) LEFT JOIN contacts_users contacts_users ON (contacts.id = contacts_users.contact_id) AND (contacts_users.deleted = ?) AND (contacts_users.user_id = ?) LEFT JOIN users jt5_user_sync ON (jt5_user_sync.id = contacts_users.user_id) AND (jt5_user_sync.deleted = ?) LEFT JOIN subscriptions contacts_following ON (contacts.id = contacts_following.parent_id) AND (contacts_following.deleted = ?) AND (contacts_following.parent_type = ?) AND (contacts_following.created_by = ?) LEFT JOIN users jt6_following_link ON (jt6_following_link.id = contacts_following.created_by) AND (jt6_following_link.deleted = ?) LEFT JOIN sugarfavorites contacts_favorite ON (contacts.id = contacts_favorite.record_id) AND (contacts_favorite.deleted = ?) AND (contacts_favorite.module = ?) AND (contacts_favorite.created_by = ?) LEFT JOIN users jt7_favorite_link ON (jt7_favorite_link.id = contacts_favorite.modified_user_id) AND (jt7_favorite_link.deleted = ?) LEFT JOIN locked_field_bean_rel contacts_locked_fields ON (contacts.id = contacts_locked_fields.bean_id) AND (contacts_locked_fields.deleted = ?) AND (contacts_locked_fields.bean_module = ?) LEFT JOIN pmse_bpm_process_definition jt8_locked_fields_link ON (jt8_locked_fields_link.id = contacts_locked_fields.pd_id) AND (jt8_locked_fields_link.deleted = ?) LEFT JOIN users jt9_assigned_user_link ON (contacts.assigned_user_id = jt9_assigned_user_link.id) AND (jt9_assigned_user_link.deleted = ?) LEFT JOIN team_sets jt10_team_count_link ON (contacts.team_set_id = jt10_team_count_link.id) AND (jt10_team_count_link.deleted = ?) LEFT JOIN email_addr_bean_rel contacts_e4e90ses_primary ON (contacts.id = contacts_e4e90ses_primary.bean_id) AND (contacts_e4e90ses_primary.deleted = ?) AND (contacts_e4e90ses_primary.bean_module = ?) AND (contacts_e4e90ses_primary.primary_address = ?) LEFT JOIN email_addresses jt11_email_addresses_primary ON (jt11_email_addresses_primary.id = contacts_e4e90ses_primary.email_address_id) AND (jt11_email_addresses_primary.deleted = ?) LEFT JOIN contacts_cstm contacts_cstm ON contacts_cstm.id_c = contacts.id WHERE ((contacts.id != ?) AND (UPPER(contacts.last_name) LIKE ?)) AND (contacts.deleted = ?) ORDER BY contacts.date_modified DESC, contacts.id DESC) a WHERE ROWNUM <= 21' with params [0, 0, 0, 1, 0, 0, 0, 0, "1", 0, "0", "Contacts", "1", 0, "0", "Contacts", "1", 0, 0, "Contacts", 0, 0, 0, 0, "Contacts", 1, 0, "59f72c7c-6e8a-11e8-828a-0242c71bf7c4", "TEST1%", 0]: ORA-00904: "CONTACTS_CSTM"."FLOWERS_SENT_C": invalid identifier

There is another issue with Prof M Applicant creation. Firebird applicant creation fails because relationship field pr_professors_leadspr_professors_ida becomes too long for Oracle. Not filing separate issue for this as we should make sure entire sample data creation package works.

{ "alias_c":"Firebird", "salutation":"Ms.", "first_name":"Janice", "last_name":"Beige", "converted":true, "status":"Converted", "tag":["Mutants"], "lead_source":"Employee", "birthdate":"1975-05-22", "status_description":"Beware: potentially volatile", "pr_professors_leadspr_professors_ida":"Professor_Beige", "account_name":"M-Men", "account_id":"SuperGroup_M-Men", "contact_id":"Student_Firebird" }