I'm troubleshooting the installation of Draggableviews and Views modules. Draggableviews sets up JavaScrip drag handles on a views list. Right now the end user page where these drag handles are shown is producing a page notice (see #1 below) (>_<)

Apparently some sites suppress this notice rather than resolve it. A Google search shows as the top hits not posts about the notice, but other pages with the same error! The UC Berkeley page seems to have simply suppressed the errors.

-----
1) End-user page error, menu [8 instances]
Notice: Undefined index: in template_preprocess_views_view_table() (line 569 of /var/www/live/ pizzeriamondo/sites/all/modules/views/theme/theme.inc).

Some things I've tried recently:
Another Views issue 1309026: "Don't render table header if all field labels are empty", posted a similar notice so I applied patch in comment #25.

Comments

Patricia_W’s picture

You can turn off error messages in /admin/config/development/logging

CliveCleaves’s picture

I figured out what was doing this on my instance, might help others.

I was using group sorting (i.e. Grouping field Nr.1 / Nr.2) in my table settings. I had used feeds to import the data, and one of my groups did not have a Nr.2 grouping field. Views didn't know what to do so got stuck there and threw up this error.

Possible Solutions:
1. Stop grouping on the field that has no data
2. Add data to the field that you want to sort by (I did this, fixed my problem)
3. Try unchecking 'Use rendered output to group rows' or try checking 'Show the empty text in the table'

(I tested one and two quite a bit, work perfectly. Not too sure about number three)

Fixing the problem is always better than just turning off error messages. :P

quiethero’s picture

Hey guys, I get these three messages on every page no matter what I do. I am not a database guru yet but I am learning. Can you step-by-step walk me through the database adjustments you made and to which specific tables and fields.

Notice: Undefined offset: 0 in /home/mysite/public_html/includes/errors.inc on line 271

Notice: Undefined index: file in /home/mysite/public_html/includes/errors.inc on line 72

Notice: Undefined index: line in /home/mysite/public_html/includes/errors.inc on line 73

I know its a db problem and it occurred on 4 separate freshly installed Drupal 7.22 sites and CiviCRM 4.33. Without one single file added other than me, the admin, none other, no adjustments no files changed and these errors appear. I am baffled and have even turned off logging as Patricia suggested and they still appear on my admin pages and production mailings.

sk2013’s picture

Issue summary: View changes

I have the same issue as #3 and any help in fixing is greatly appreciated.

Thanks,

sk2013’s picture

I appreciate the help in fixing the following error message appearing in production even after turning the error logging and after PHP upgrade to latest version. The error is captured at the server (Apache) logs and not at the Report Logs by Drupal.

Could some one through light on this..

Notice: Undefined offset: 0 in /home/mysite/public_html/includes/errors.inc on line 271

Notice: Undefined index: file in /home/mysite/public_html/includes/errors.inc on line 72

Notice: Undefined index: line in /home/mysite/public_html/includes/errors.inc on line 73

Thanks for the help

erwangel’s picture

Same here, apache logs say where the errors are (in errors.inc !) but no idea where they come from.
Same lines as sk2013 (#5) . apache's mod_fcgid could be the cause ?
mod_fcgid: stderr: PHP Notice: Undefined offset: 0 in ... line 271 ; Undefined index: file in ... line 72 ; Undefined index: line in ... line 73

Nicolas Bouteille’s picture

Same problem here, what's weird also is that these messages don't get displayed like normal error messages. They get displayed at the bottom of the page. Maybe because I am using Omega 4 but...
I have additional info for each message

( ! ) Notice: Undefined Offset: 0 In Includes/Errors.inc On Line 271
Call Stack
#	Time	Memory	Function	Location
1	59.2066	115194688	_drupal_error_handler( )	../bootstrap.inc:0
2	59.2067	115194688	_drupal_error_handler_real( )	../bootstrap.inc:2331
3	59.2067	115207984	_drupal_get_last_caller( )	../errors.inc:59

( ! ) Notice: Undefined Index: File In Includes/Errors.inc On Line 72
Call Stack
#	Time	Memory	Function	Location
1	59.2066	115194688	_drupal_error_handler( )	../bootstrap.inc:0
2	59.2067	115194688	_drupal_error_handler_real( )	../bootstrap.inc:2331

( ! ) Notice: Undefined Index: Line In Includes/Errors.inc On Line 73
Call Stack
#	Time	Memory	Function	Location
1	59.2066	115194688	_drupal_error_handler( )	../bootstrap.inc:0
2	59.2067	115194688	_drupal_error_handler_real( )	../bootstrap.inc:2331

All this is displayed in a sort of table...

I noticed that these messages get displayed everytime I stop working on my site for a moment and then I come back on it. The page takes time to load, I can see the errors if I scroll to the bottom, and if I refresh again it loads fast with no error.
I don't have this problem in production so maybe this is linked to MAMP ? It looks like a memory problem...

Nicolas Bouteille’s picture

Looks like a lot of websites on Google are having these errors

Nicolas Bouteille’s picture

I don't think this is a Views problem though. We should probably move this to Core.

Nicolas Bouteille’s picture

Ok I think I found out what that was. I inspected the error table and it had the class xdebug something... indeed I had xdebug enabled on my MAMP. So I disabled it, restarted everything and it seems I don't get the heavy first load nor the errors at the bottom. Actually all page loads seem a bit faster.
I also disabled on my MAMP Pro host the feature to make my dev website available on my LAN (useful for mobile and IE testings).

Nicolas Bouteille’s picture

Alright I take it back! I just got a long page load with the same errors at the bottom. The design has changed now they're just inside the body not wrapped inside a specific div. So it was not linked to xdebug.

Nicolas Bouteille’s picture

Another lead: I had a module and a theme with the exact same machine name. Since I changed that, it looks like the error went away.

Nicolas Bouteille’s picture

As soon as I write this, the error is back... nevermind !

berimbolo’s picture

The issue seems to be when a debugging call is made directly from main()
This seems to fix it:

On line 264 replace
while (($backtrace && !isset($backtrace[0]['line'])) ||

with

while (($backtrace && !isset($backtrace[0]['line']) && (count($backtrace) > 1) ) ||