I developed a plugin for Joomla!, and I have the below sql parameter field in my sampleplugin.xml

    label="Select CB fields"
    query="SELECT name FROM #__comprofiler_fields WHERE `table`= '#__comprofiler' AND `published`='1' AND `type`='text'"
    multiple="multiple" />

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

Thank you.

  • because you have abandoned this page, the system keeps bumping it to the top of the question queue. Please come back to us and progress this page to a system-recognized resolution.
    – mickmackusa
    Sep 7 '20 at 23:50

Create a custom form field type. From SQL form field type documentation:


Using this generic form field type forces you to write SQL in an XML file and is rather limited. For more flexibility, consider creating your own, specific form field type by subclassing the JFormField class.



  • How to define a custom form field type inside the plugin xml file ?
    – ahmad
    Dec 16 '18 at 15:11
  • From Creating a custom form field type documentation: Using the custom field type > To use the field type City, we need to update the XML file that contains the form fields. Open your XML file located in administrator/components/com_phonebook/models/forms and add the field in the usual way... @sharky
    – ahmad
    Dec 16 '18 at 15:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.