[SOLVED] 12 arguments are required, 2 given

Status
Not open for further replies.
With php8 you must update from GitHub.
But nobody reported ever such an error so I don't think it's coming from Fabrik.
Anyway
Where? Enable Joomla System Debug to get an error stack.
 
Did'nt help updateing from github.
Did'nt change anything change to joomla own template.
 
If you want to get help please read anwers to your questions, give necessary informations etc.
But nobody reported ever such an error so I don't think it's coming from Fabrik.
Anyway
Where? Enable Joomla System Debug to get an error stack.
 
It seems like it's the calculation field that I use...
When using php8 or above there is a problem.
upload_2023-2-22_7-58-0.png
 
Last edited:
Which exact Fabrik and Joomla version are you running?
Which Joomla template is showing such an error page?

The given code lines don't match the recent Fabrik 3 GitHub version.

So please update from GitHub.
- Fabrik3: WIKI: Update from GitHub (especially if you are using PHP8)

Additionally check your code in your calc element. It seems to create an error.
 
Someone knows more about code , that can help me, this is my calc element.
PHP:
// Get a db connection.
$db = JFactory::getDbo();

// Create a new query object.
$query = $db->getQuery(true);

//Select all records from the nemmanus_elementer table where elementer_manus_id same as nemmanus_manus___manus_id.
$query->select($db->quoteName(array('elementer_duration')));
$query->from($db->quoteName('nemmanus_elementer'));
$query->where($db->quoteName('elementer_manus_id') . ' = ' . $db->quote('{nemmanus_manus___manus_id}'));

// Reset the query using our newly populated query object.
$db->setQuery($query);

// Load the results as a list of stdClass objects (see later for more options on retrieving data).
$durations = $db->loadObjectList();

$myDur = 0;
foreach ($durations as $duration)
{
    $myDur+= strtotime("1970-01-01" . $duration->elementer_duration . "Z");
}

if ($counts <> 0) {
$output = sprintf('%02d:%02d:%02d', ($myDur/ 3600),($myDur/ 60 % 60), $myDur% 60);
return $output;
} else {
$output = sprintf('%02d:%02d:%02d', ($myDur/ 3600),($myDur/ 60 % 60), $myDur% 60);
return $output;
}

Seems that my sprintf code are the problem, but why?
 
Last edited:
I have now hardcoded the $output, then the error looks like this:
upload_2023-2-23_17-6-57.png

Do you get anything usefull out of that?
 
Last edited:
As the error message tells you: "Undefined variable $counts" (which produces only a Notice in php7 but a warning in php8).
So fix your calc code.


But thanks to your example the issue about non-escaped-% in eror logging showed up;)
 
Now I got rid of the counts problem.
I get a implicit conversion error now:
upload_2023-2-24_8-27-22.png

How can I find thatconversion error?
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top