public inbox for [email protected]  
help / color / mirror / Atom feed
[pgAdmin4][Patch]: Select2 control destroy issue [Minor fix]
4+ messages / 2 participants
[nested] [flat]

* [pgAdmin4][Patch]: Select2 control destroy issue [Minor fix]
@ 2016-10-14 10:09 Surinder Kumar <[email protected]>
  2016-10-14 19:20 ` Re: [pgAdmin4][Patch]: Select2 control destroy issue [Minor fix] Dave Page <[email protected]>
  0 siblings, 1 reply; 4+ messages in thread

From: Surinder Kumar @ 2016-10-14 10:09 UTC (permalink / raw)
  To: pgadmin-hackers

Hi

While clicking on Select2 control, it tries to destroy the control and thus
it doesn't get this object sometimes and throws error.

It should attempt to destroy the select2 object only if this object is not
undefined.
Adds proper check to handle the case.

Please find minor patch and review.

Thanks
Surinder Kumar


-- 
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Attachments:

  [application/octet-stream] select2_control_destroy_issue.patch (441B, 3-select2_control_destroy_issue.patch)
  download | inline diff:
diff --git a/web/pgadmin/static/js/backform.pgadmin.js b/web/pgadmin/static/js/backform.pgadmin.js
index 1d96de0..b685b6c 100644
--- a/web/pgadmin/static/js/backform.pgadmin.js
+++ b/web/pgadmin/static/js/backform.pgadmin.js
@@ -1894,7 +1894,7 @@
     ].join("\n")),
     render: function() {
 
-      if(this.$sel && this.$sel.select2) {
+      if(this && this.$sel && this.$sel.select2) {
         this.$sel.select2('destroy');
       }
 


^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: [pgAdmin4][Patch]: Select2 control destroy issue [Minor fix]
  2016-10-14 10:09 [pgAdmin4][Patch]: Select2 control destroy issue [Minor fix] Surinder Kumar <[email protected]>
@ 2016-10-14 19:20 ` Dave Page <[email protected]>
  2016-10-21 14:55   ` Re: [pgAdmin4][Patch]: Select2 control destroy issue [Minor fix] Surinder Kumar <[email protected]>
  0 siblings, 1 reply; 4+ messages in thread

From: Dave Page @ 2016-10-14 19:20 UTC (permalink / raw)
  To: Surinder Kumar <[email protected]>; +Cc: pgadmin-hackers

Thanks, applied.

On Friday, October 14, 2016, Surinder Kumar <[email protected]>
wrote:

> Hi
>
> While clicking on Select2 control, it tries to destroy the control and
> thus it doesn't get this object sometimes and throws error.
>
> It should attempt to destroy the select2 object only if this object is not
> undefined.
> Adds proper check to handle the case.
>
> Please find minor patch and review.
>
> Thanks
> Surinder Kumar
>


-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: [pgAdmin4][Patch]: Select2 control destroy issue [Minor fix]
  2016-10-14 10:09 [pgAdmin4][Patch]: Select2 control destroy issue [Minor fix] Surinder Kumar <[email protected]>
  2016-10-14 19:20 ` Re: [pgAdmin4][Patch]: Select2 control destroy issue [Minor fix] Dave Page <[email protected]>
@ 2016-10-21 14:55   ` Surinder Kumar <[email protected]>
  2016-10-21 15:16     ` Re: [pgAdmin4][Patch]: Select2 control destroy issue [Minor fix] Dave Page <[email protected]>
  0 siblings, 1 reply; 4+ messages in thread

From: Surinder Kumar @ 2016-10-21 14:55 UTC (permalink / raw)
  To: Dave Page <[email protected]>; +Cc: pgadmin-hackers

​I missed to add the check "destroy only if select2 has destroy property'.
in previous patch.
It was reproducible when I select access method of exclusion constraint
from combo box.

Please find attached patch and review.

On Sat, Oct 15, 2016 at 12:50 AM, Dave Page <[email protected]> wrote:

> Thanks, applied.
>
>
> On Friday, October 14, 2016, Surinder Kumar <surinder.kumar@enterprisedb.
> com> wrote:
>
>> Hi
>>
>> While clicking on Select2 control, it tries to destroy the control and
>> thus it doesn't get this object sometimes and throws error.
>>
>> It should attempt to destroy the select2 object only if this object is
>> not undefined.
>> Adds proper check to handle the case.
>>
>> Please find minor patch and review.
>>
>> Thanks
>> Surinder Kumar
>>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>


-- 
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Attachments:

  [application/octet-stream] select2_control_destroy_issue_v2.patch (497B, 3-select2_control_destroy_issue_v2.patch)
  download | inline diff:
diff --git a/web/pgadmin/static/js/backform.pgadmin.js b/web/pgadmin/static/js/backform.pgadmin.js
index 60a5c78..8d2d280 100644
--- a/web/pgadmin/static/js/backform.pgadmin.js
+++ b/web/pgadmin/static/js/backform.pgadmin.js
@@ -1894,7 +1894,8 @@
     ].join("\n")),
     render: function() {
 
-      if(this && this.$sel && this.$sel.select2) {
+      if(this.$sel && this.$sel.select2 &&
+        this.$sel.select2.hasOwnProperty('destroy')) {
         this.$sel.select2('destroy');
       }
 


^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: [pgAdmin4][Patch]: Select2 control destroy issue [Minor fix]
  2016-10-14 10:09 [pgAdmin4][Patch]: Select2 control destroy issue [Minor fix] Surinder Kumar <[email protected]>
  2016-10-14 19:20 ` Re: [pgAdmin4][Patch]: Select2 control destroy issue [Minor fix] Dave Page <[email protected]>
  2016-10-21 14:55   ` Re: [pgAdmin4][Patch]: Select2 control destroy issue [Minor fix] Surinder Kumar <[email protected]>
@ 2016-10-21 15:16     ` Dave Page <[email protected]>
  0 siblings, 0 replies; 4+ messages in thread

From: Dave Page @ 2016-10-21 15:16 UTC (permalink / raw)
  To: Surinder Kumar <[email protected]>; +Cc: pgadmin-hackers

Thanks, applied.

On Fri, Oct 21, 2016 at 3:55 PM, Surinder Kumar
<[email protected]> wrote:
> I missed to add the check "destroy only if select2 has destroy property'. in
> previous patch.
> It was reproducible when I select access method of exclusion constraint from
> combo box.
>
> Please find attached patch and review.
>
> On Sat, Oct 15, 2016 at 12:50 AM, Dave Page <[email protected]> wrote:
>>
>> Thanks, applied.
>>
>>
>> On Friday, October 14, 2016, Surinder Kumar
>> <[email protected]> wrote:
>>>
>>> Hi
>>>
>>> While clicking on Select2 control, it tries to destroy the control and
>>> thus it doesn't get this object sometimes and throws error.
>>>
>>> It should attempt to destroy the select2 object only if this object is
>>> not undefined.
>>> Adds proper check to handle the case.
>>>
>>> Please find minor patch and review.
>>>
>>> Thanks
>>> Surinder Kumar
>>
>>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers




^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2016-10-21 15:16 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-10-14 10:09 [pgAdmin4][Patch]: Select2 control destroy issue [Minor fix] Surinder Kumar <[email protected]>
2016-10-14 19:20 ` Dave Page <[email protected]>
2016-10-21 14:55   ` Surinder Kumar <[email protected]>
2016-10-21 15:16     ` Dave Page <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox