Suitecrm: Can't rename custom relationship labels

Created on 25 Aug 2019  路  7Comments  路  Source: salesagility/SuiteCRM



Issue


When I try to rename a custom relationship label in studio and click "save & deploy" even though I get the "This operation is completed successfully" message but the label revert to it's original value and does not update.

Expected Behavior


As with non-relationship labels after clicking on the "save & deploy" button the label should keep it's changed name.

Actual Behavior



After clicking the "save & deploy" button the name of the relationship labels do not save and revert to it's original name.

Possible Fix


A possible reason for the bug is that the function addLabels in public/modules/ModuleBuilder/parsers/parser.label.php does not act differently for custom relationship labels then other non-relationship labels and therefor does not update all the extra files associated with relationship labels.

Steps to Reproduce



1.Create a new custom relationship.
2.Rename it in studio on the labels page.
3.Click "save & deploy".

Context



This appear to be a long time issue that is referenced in #551, #3872, #2886 and https://suitecrm.com/suitecrm/forum/suitecrm-7-0-discussion/2562-renaming-relationship-label.
and yet it is still not solved. Even though this bug is only visual, it is a common occurrence to rename a relationship and so this bug is easily found and I think should be given a medium priority.

Your Environment

  • SuiteCRM Version used:7.11.4
  • Browser name and version (e.g. Chrome Version 76.0.3809.100 (64-bit)):
  • Environment name and version (e.g. MySQL, PHP 7.2):
  • Operating System and version (e.g Ubuntu 18.04):
Studio Important Bug

All 7 comments

Hi @Tuckan

Is there any difference between this new Issue here and the older ones you link to? I'm just wondering if we need this one. Thanks.

Here is a fix I do on every update.
In /SuiteCRM/include/SugarObjects/LanguageManager.php

Function: "refreshLanguage"

Original Array:

$lang_paths = array(
'modules/'.$module.'/language/'.$lang.'.lang.php',
'modules/'.$module.'/language/'.$lang.'.lang.override.php',
'custom/modules/'.$module.'/language/'.$lang.'.lang.php',
'custom/modules/'.$module.'/Ext/Language/'.$lang.'.lang.ext.php',
);

It should be like this:

$lang_paths = array(
'modules/'.$module.'/language/'.$lang.'.lang.php',
'modules/'.$module.'/language/'.$lang.'.lang.override.php',
'custom/modules/'.$module.'/Ext/Language/'.$lang.'.lang.ext.php',
'custom/modules/'.$module.'/language/'.$lang.'.lang.php',
);

The order of the last two lines is reversed. Unfortunately this change is not upgrade safe.

Well, should that be a PR made to core? Does it have any down-sides that you know of?

Its just a CC from this topic :

https://suitecrm.com/suitecrm/forum/suitecrm-7-0-discussion/2562-renaming-relationship-label

I have no down sides that I know, but you should read the entire topic cause im not a pro !

Its just a part of my after-update.doc that I do on every update ahah

Hhmm it seems to come from a SugarCRM hotfix, I'd say it should be safe to use in core.

What do you think @samus-aran?

@holdusback I tried that fix but unfortunately it did not fix the issue.

@pgorod I think the issue is similar to the older issues, I wanted to collect all data of the bug into one place and to inform that the fix from #551 did not solve the issue completely.

From my debugging I noticed that on parser.label.php in the function addLabels the parameter $forRelationshipLabel is set to false when renaming relationship labels. I tried setting it to true and label changes but the value reverts back after repair & rebuild.

Confirmed in 7.11.8

Was this page helpful?
0 / 5 - 0 ratings