• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

loading Fabrik instance on external class --> dropdown not rendered ?

lcollong

FabriKant d'applications web
Hi,

My app has a class to manipulate mySQL table outside regular forms (computations/updates/crons).
For pdf rendering, I need to load data "as Fabrik" in order to get rendered values. Thus the method I wrote :
PHP:
    public function loadFabrikRow($rowid, $listid = 0){
        $rowid = intval($rowid);
        $listid = intval($listid);
       
        if ($rowid < 1 ) {
            $this->JLog('loadFabrikRow - rowid invalide : '.$rowid, JLog::ERROR, 'Synapse');           
            return false;
        }
       
        if ($listid < 1) $listid = intval($this->fabrikListId);
        if ($listid < 1) {
            $this->JLog('loadFabrikRow - listid invalide : '.$listid, JLog::ERROR, 'Synapse');           
            return false;
        }
        $formModel = JModelLegacy::getInstance('Form', 'FabrikFEModel');
        $formModel->setId($listid);   
        $listModel = $formModel->getlistModel();       
        $row = $listModel->getRow($rowid, true, true);
        $this->fabrikData = is_object($row) ? FArrayHelper::fromObject($row, true) : $row;
        // echo "<pre>";print_r($row);echo "</pre>";
        return $this->fabrikData;
    }

Almost everything is rendered as if it was displayed in a form/details view (fabrikData contains an array with both raw values and rendered ones). Except a very basic dropdown. Both regular and raw value contain the same data. The raw one indeed. Can't get the corresponding label.

Did I forget something ?

Thanks
 
Is your element set to show in list view (resp. to "always render" in element settings)?
 
Well done :)
Marking it as "always render" does the job. Thanks.
However I'd expect to get the equivalent of the form load data ?....
 
Hmm, don't know.
Did you try without ACL restrictions?
Is it with all dbjoins or only this special one?
 
DBjoins elts are rendering ok. This one is a regular dropdown with nothing special except ACL. I'll try without ACL but I can't leave it. Since it works with "always render", I'll stop here. Thanks for your "clear vision" :)
 
Yes the "always render" does not modify the form/details view nor its behavior. The list view still works and my script is now loading the right things ! :)
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top