Ext JS 6 Duplicate Entity Name Error

When I reopened Account Profile tab after closing it, I got following error (shown in browser's console)

Duplicate entity name "AccountProfileModelList": AccountProfileModelList and AccountProfileModelList(…)

 

In this page, I defined a Model named AccountProfileModelList

 

When opening the Account Profile tab first time, the AccountProfileModelList will be defined. And when opening the tab second time, the AccountProfileModelList will be defined again. This is why the error appeared.

What's interesting is that In Ext 5 above scenario won't cause any error, but in Ext 6, a model cannot be defined twice anymore.

 

To fix this issue, we need use typeof(AccountProfileModelList) == 'undefined'  to check whether the model is already defined, if it's defined the model creation code won't be executed.

So the above code should be changed to

 

A more Ext way to detect whether a Ext class is already defined is using Ext.ClassManager.isCreated(className)

Above code can also be changed to

 

Ext JS 6 Invalid Component Id

In Ext 6, I got following error

ExtJs invalid component id "profile.ModifyUserBasicInfo"

 

Following is code producing the error

 

This error doesn't appear in Ext 5, after upgrading to Ext 6, it appears now.

 

It is caused by the id property cannot contain "." symbol, but the id property we used here is profile.ModifyUserBasicInfo

To fix this issue, we can replace all "." to "-".

 

Following link from describes the id property naming rule

http://docs.sencha.com/extjs/6.2.1/classic/Ext.window.Window.html#cfg-id

The original quote

Note: Valid identifiers start with a letter or underscore and are followed by (optional) additional letters, underscores, digits or hyphens.

 

 

 

MySQL find all MyISAM tables

The information_schema table saves information about databases, tables, columns, indexes and triggers, etc.

 

To list all MyISAM tables, we can use following SQL

 

And to find MyISAM tables in database wordpress

 

Next filter them with a table prefix wp_