Notice: Undefined index: quantity in tao_views_mini_pager() (line 440 of [...]sites/all/themes/tao/template.php).
I get this error and can't find any documentation about it or any issue in the issue queue.
I tried kpr($vars) in the function tao_views_mini_pager($vars){} and there is no 'quantity' in the $vars, which means the code
$quantity = $vars['quantity'];
quite justly throws an error. I did a quick and dirty fix like this:
if (isset($vars['quantity']) && !empty($vars['quantity'])) {
$quantity = $vars['quantity'];
}
else {
$quantity = 0;
}
I'm not very good at the inner workings of Views pager functionality or the TAO theme, so I find myself unable to fix the problem in a proper way. I'm not even sure if it is an important problem. But I'm reporting it as a bug.
(Drupal 7.23 and Views 7.x-3.7)
Comment | File | Size | Author |
---|---|---|---|
#4 | tao-undefined_index_quantity-2060179-4.patch | 721 bytes | mariacha1 |
Comments
Comment #1
haydeniv CreditAttribution: haydeniv commentedI think this was actually a views bug. Are you still having this issue with the latest version of views?
Comment #2
mxhHi, I have the same problem (using latest Views 7.x-3.7). It always appears when I open a view with a mini pager. The view I use was built with an older version. I will rebuild the view with the current version of Views next time and see if the error is gone. If so, then I guess this is a result from a Views bug.
Comment #3
haydeniv CreditAttribution: haydeniv commentedPlease check against the latest dev release of Views 7.x-3.x.
Comment #4
mariacha1 CreditAttribution: mariacha1 commentedI believe that the issue that fixed this is #1000480: Provide quantity/tags in the pager settings.. Unfortunately, that fix actually only works with Full pagers. I'm still seeing the warning if I use mini pagers though.
However, looks like the $pager_middle variable that $quantity helps define is unused in the tao_views_mini_pager function (makes sense, since mini pagers don't really have the idea of a middle). I'm including a patch to strip that unneeded code out.
Comment #5
mariacha1 CreditAttribution: mariacha1 commentedComment #6
mariacha1 CreditAttribution: mariacha1 commentedNow that I look at the patch, I see someone fixed the issue entirely in the dev version, making these changes unneccessary (although I still think my solution is better) :).
No need to waste everyone's time. I'm going to set this as fixed, and let maintainers apply the patch if they care to.
Comment #7
mariacha1 CreditAttribution: mariacha1 commentedComment #8
sonicthoughts CreditAttribution: sonicthoughts commentedI see this issue is closed, but i just got the error:
Notice: Undefined index: quantity in tao_views_mini_pager() (line 465 of sites/all/themes/tao/template.php).
Using Tao 3.1 and views 3.10
was the patch committed?