[pve-devel] [PATCH manager] Fix SafeDestroy when entering a numeric resource ID

Dominik Csapak d.csapak at proxmox.com
Mon Jun 19 09:07:52 CEST 2017


Acked-by: Dominik Csapak <d.csapak at proxmox.com>

On 06/14/2017 11:22 AM, Emmanuel Kasper wrote:
> In a previous commit, the inputField of SafeDestroy.js was converted
> from a numberfield to a textfield to allow ceph pools names to be
> entered.
> This means the type of 'value' changed from number to string and
> the strong equal test === was failing against a numeric id.
> To solve this, we now always stringify the resource id before comparing.
> ---
>  www/manager6/window/SafeDestroy.js | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/www/manager6/window/SafeDestroy.js b/www/manager6/window/SafeDestroy.js
> index 5093dbf1..23e4c04a 100644
> --- a/www/manager6/window/SafeDestroy.js
> +++ b/www/manager6/window/SafeDestroy.js
> @@ -31,7 +31,7 @@ Ext.define('PVE.window.SafeDestroy', {
>  		change: function(f, value) {
>  		    var view = this.getView();
>  		    var removeButton = this.lookupReference('removeButton');
> -		    if (value === view.getItem().id) {
> +		    if (value === view.getItem().id.toString()) {
>  			removeButton.enable();
>  		    } else {
>  			removeButton.disable();
>





More information about the pve-devel mailing list