• 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.

datebasejoin element according id passed via url (default?)

tanya2015

Member
Hello,
I have problem with default value of element. I have list php button to add data from file. I pass row id via url and open te form (see jpg). (I can't do related list because I've alredy has one, user must have clear choice).
date is a databasejoin (date with time I see in dropdown). I need that always first element database join was date according id from url. Now it's Please Select.

Code:
$dateid = $_GET["zayavky___ex_date_raw"];
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select($db->quoteName('exdate'))->from($db->quoteName('groups'))->where($db->quoteName('id')." = ".$db->quote($dateid));
$db->setQuery($query);
$ex_date = $db->loadResult(); /here I got date according id/
 if (!empty($ex_date))
  {$options[] = JHTML::_('select.option', $value = $dateid, $text = $ex_date, 'value', 'text', $disable=true);
   return $options[];
}
Yes, i understood I make something wrong in $option... this is not string.... But don't have idea
using code above I've always got error
Warning: strpos() expects parameter 1 to be string, object given in C:\OSPanel\domains\aes.local\libraries\src\Language\Text.php on line 98

Warning: explode() expects parameter 2 to be string, object given in C:\OSPanel\domains\aes.local\libraries\src\Language\Text.php on line 104

Warning: Invalid argument supplied for foreach() in C:\OSPanel\domains\aes.local\libraries\src\Language\Text.php on line 107

Warning: array_shift() expects parameter 1 to be array, null given in C:\OSPanel\domains\aes.local\libraries\src\Language\Text.php on line 112

Warning: strtoupper() expects parameter 1 to be string, object given in C:\OSPanel\domains\aes.local\libraries\src\Language\Language.php on line 314

Warning: strpos() expects parameter 1 to be string, object given in C:\OSPanel\domains\aes.local\libraries\src\Language\Language.php on line 361

Catchable fatal error: Object of class stdClass could not be converted to string in C:\OSPanel\domains\aes.local\libraries\src\Language\Language.php on line 364

Thank you for any idea.
 

Attachments

  • 21.jpg
    21.jpg
    23.5 KB · Views: 63
Hi, instead of $options...just write:

Code:
return $date_id;

If you set the value of databasejoin element, corresponding label (set in databasejoin element settings) is displayed in the dropdown.
 
Last edited:
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top