[pve-devel] [PATCH v2 manager 2/2] ui: cert upload: fix private key field sending empty string

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Mar 8 07:34:47 CET 2023


Am 07/03/2023 um 19:33 schrieb Thomas Lamprecht:
>> diff --git a/www/manager6/node/Certificates.js b/www/manager6/node/Certificates.js
>> index 34013b44..84fc12ff 100644
>> --- a/www/manager6/node/Certificates.js
>> +++ b/www/manager6/node/Certificates.js
>> @@ -173,6 +173,9 @@ Ext.define('PVE.node.CertUpload', {
>>  	    emptyText: gettext('No change'),
>>  	    name: 'key',
>>  	    xtype: 'textarea',
>> +	    getSubmitValue: function() {
>> +		return this.getValue() || null;
>> +	    },
> 
> This works by luck, submitData is a boolean config for the textarea [0], and
> getSubmitValue has nothing to do with the actual value, but just is the getter
> for the submitValue bool, which the private actual getSubmitData fn checks [1]
> 

Actually I was mistaken here (thanks Dominik for the reminder), here it indeed is
the getter for the processed raw value even if there's a boolean config for
submitValue - meh. But I'd still go for the inputpanel way in two patches, as that
cleans the whole thing up nicer and avoid depending on a bit more internal details,
making it more explicit.


> [0]: https://docs.sencha.com/extjs/7.0.0/classic/Ext.form.field.TextArea.html#cfg-submitValue
> [1]: https://docs.sencha.com/extjs/7.0.0/classic/src/Base.js-2.html#Ext.form.field.Base-method-getSubmitData
> 






More information about the pve-devel mailing list