Closed R-J closed 7 years ago
R-J that's how it works ! Thanks and regards
if(substr($Key, 0, 10) != 'BadgeEdit_') { //$RealKey = substr($Key, 7); $Criteria[$Key] = $Value; }
By implementing #2 would you not have to also trim the "BadgeEdit_" prefix off the front of the other form values so that they store correctly?
I hope you are asking @steam1 and not me, since I never really made those changes but was just thinking about how that could be done...
For now I've hard coded the rules and perks fields in manually which works for my own implementation to get it working. @steam1 could you let me know if you have a more flexible solution done?
Closed by #148
That's a decent solution for the issue. This also needs to be done for Ranks as well.
The BadgeControllers Edit() method tries to fetch the rules form fields based on a prefix "_Rules" before the form fields. The RulesControllers GetCriteriaForm() supplies the forms through an AJAX call. Before the FormString gets built, Form->InputPrefix is set to "_Rules" in order to prefix every form field.
But InputPrefix has been deprecated. That's why there is no prefix any more before the form field names and therefore they cannot be found.
This is the reason for this error https://github.com/hgtonight/Application-Yaga/issues/142
I see four ways to react on that:
['name' =>'_Rules/ElementName']
attribute. That way no logic would have to be changed. The downside is that people with custom rules may face problems.if(substr($Key, 0, 7) == '_Rules/') {
toif(substr($Key, 0, 10) != 'BadgeEdit_') {
. You would only have to change two files then and everything else could stay the same.