× Please submit new Bug Reports on GitHub: github.com/Jensen-Technologies/component-creator-issues/issues

Use the “sql” form field type in config.xml only if the table exists

pred 7 rokmi 5 mesiacmi #1582 od Yiannis Christodoulou
Hi guys,

I developed an extension for Joomla!, and I have the below sql parameter field in my config.xml
<field name="include_categories_k2" type="sql" default="" label="Include K2 Cats" description="" query="SELECT id, name FROM #__k2_categories ORDER BY name" key_field="id" value_field="name" multiple="true" />

I got sql error because the K2 is not installed on a client's website. The problem is how to check if the table #__k2_categories exists first before getting data from there?

Ok, one solution is to create elements and check there if the component exists, but is there another simple solution to avoiding create custom elements?

Thank you.

Prosím Prihlásiť alebo Registrácia pre zdieľanie konverzácie.

Čas vytvorenia stránky: 0.047 sekúnd
Funguje na Kunena fórum

We use cookies so that you can place orders and we can provide a better service. You can control the use of cookies at the individual browser level. If you reject cookies, you may still use our website, but your ability to use some features or areas of our website may be limited.