revolution icon indicating copy to clipboard operation
revolution copied to clipboard

Add guard-clause to clearDirty method [2.x]

Open sebastian-marinescu opened this issue 2 years ago • 2 comments

What does it do?

This makes sure the JS doesn't throw an error in the case that the items-object is an array, just like in https://github.com/modxcms/revolution/pull/16404 for 3.x

Why is it needed?

When using ExtJS to create components of the xtype: 'radiogroup' to be used in CMPs inside a form, this function gets called and tries to iterate over it's items array with a method that doesn't exist.

This PR isn't changing the way forms or the clearDirty-method are handled, it just assures no error is thrown when using radiogroup-components.

Related issue(s)/PR(s)

Resolves https://github.com/modmore/ClientConfig/issues/202 Resolves https://github.com/modmore/ClientConfig/pull/176 Resolves https://github.com/modmore/ClientConfig/issues/143

sebastian-marinescu avatar Sep 04 '23 21:09 sebastian-marinescu

@opengeek @Mark-H

Hi guys, can we also tag/label this for the v2.8.6-milestone, please?

I'd appreciate it ❤️

sebastian-marinescu avatar Sep 15 '23 22:09 sebastian-marinescu

Thank you very much @Ibochkarev

sebastian-marinescu avatar Sep 16 '23 06:09 sebastian-marinescu

This change is currently breaking the grunt build with the following error:

Running "uglify:jsgrps" (uglify) task
JS_Parse_Error [SyntaxError]: Unexpected token: punc «.»
    at JS_Parse_Error.get (eval at <anonymous> (/Users/opengeek/www/revo-2.x/_build/templates/default/node_modules/uglify-js/tools/node.js:18:1), <anonymous>:71:23)
    at formatError (internal/util/inspect.js:1149:38)
    at formatRaw (internal/util/inspect.js:919:14)
    at formatValue (internal/util/inspect.js:774:10)
    at inspect (internal/util/inspect.js:319:10)
    at formatWithOptionsInternal (internal/util/inspect.js:1979:40)
    at formatWithOptions (internal/util/inspect.js:1861:10)
    at console.value (internal/console/constructor.js:328:14)
    at console.log (internal/console/constructor.js:364:61)
    at /Users/opengeek/www/revo-2.x/_build/templates/default/node_modules/grunt-contrib-uglify/tasks/uglify.js:144:17 {
  filename: 'util/utilities.js',
  line: 85,
  col: 22,
  pos: 2432
}

opengeek avatar Feb 27 '24 20:02 opengeek

I'd really like to move forward on this. What needs to be done?

opengeek avatar Mar 18 '24 18:03 opengeek

I'd really like to move forward on this. What needs to be done?

Hey Jason -- working on the build routine for 2.x to bring it in line with 3.x (will solve these problems that are cropping up) ... should be good in the next day or two.

smg6511 avatar Mar 18 '24 21:03 smg6511