Home > Forum > General discussion/Presale questions > Site Discussion > Undefined offset 0 quiz.php line 401
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Undefined offset 0 quiz.php line 401

Undefined offset 0 quiz.php line 401 2 years 7 months ago #25520

  • James
  • James's Avatar
  • Fresh Boarder
  • Posts: 4
  • Karma: 0

Another Notice so not necessarily a problem
Notice: Undefined offset: 0 in C:\.........\components\com_joomlaquiz\models\quiz.php on line 401
This line is using the list function to assign a result to a single variable which as it stands looks a bit overkill however there might be a reason for this or it could be legacy or future expansion.

The function being called is the JEventDispatcher trigger which returns an array of results so we have changed it to not do anything on an empty array of results and therefore doesn't complain about an undefined offset, otherwise we take the first array element.
list($processed_desc) = $dispatcher->trigger('onQuizCustomFieldsRender', array($quiz_params->c_description));
if($processed_desc) $quiz_params->c_description = $processed_desc;
if(!empty($processed_desc = $dispatcher->trigger('onQuizCustomFieldsRender', array($quiz_params->c_description)))) $quiz_params->c_description = $processed_desc[0];
Last Edit: 2 years 7 months ago by James. Reason: Needs to be moved to Joomla Quix Deluxe Category please
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 0.139 seconds

We do our best to secure your data and to be
GDPR compliant.
However, we are not fully there yet.

With that said we'd like you to know that we use cookies.
We store user session cookie only to enable both registered and guest users to use the shopping cart.
Please note that 3rd party cookies may still be encountered on the pages with social media "share" and "like" buttons.

To ensure your privacy we have currently stopped using any analytics tools like Google Analytics.

We anonymize your IP address on the server side so your IP is not tracked by any means.

We DO NOT pass ANY of your data to 3rd parties.
We will do our best to provide maximum transparency in future if anything will change.

Also, we will store cookies to determine if you saw this message.