Closed (fixed)
Project:
Date Reminder
Version:
7.x-1.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
30 Mar 2013 at 20:21 UTC
Updated:
25 Sep 2013 at 03:51 UTC
When simply editing my node type, I get the following error:
- Notice: Undefined index: node in datereminder_alter_node_type_form()
- Warning: in_array() expects parameter 2 to be array, null given in datereminder_alter_node_type_form() (line 102 from ... .../public_html/sites/all/modules/datereminder/includes/node_form.inc).
Anything I'm doing wrong possibly?
Comments
Comment #1
dwillcox commentedCurious. I haven't seen this before.
Let me ask. Is it possible that you've defined a date-type field that isn't currently used in any node type? Maybe it's used in some entity type other than node? The code in question looks like this:
Apparently $field['bundles']['node'] is NULL, which I guess means the field is in no nodes.
That would be an easy enough case to check for, but I'd appreciate it if you could verify that that's a plausible explanation.
Comment #2
dwillcox commentedI tried to figure out a way to reproduce this, but couldn't. I don't know all of the ins and outs of Drupal 7, but I gather there's a way to create fields for entities other than nodes.
If you have a suggestion, please let me know.
Comment #3
christophedg commentedThis is another error I just got when deleting 3 reminders that had expired in the 'View all' tab.
Notice: Undefined offset: 1 in theme_datereminder_manage_reminders() (line 377 from ... .../public_html/sites/all/modules/datereminder/includes/datereminder_form.inc).
In the content type, I use a classic Date fieldtype with a pop-up widget. This field is also used in some other node types.
As far as I can see, I don't have any date-type fields that aren't currently used or are used in other entity types than node...
Some other settings:
- On the node type I chose 'Allowed, off by default'
- Permissions: Verified users can request reminders and send reminders to arbitrary email addresses
Comment #4
dwillcox commentedHmm. I wonder if you have error reporting set to complain about some of those "technically incorrect but normally benign" cases. PHP is is pretty forgiving about things like referencing null values. For example "in_array($value,$array)" will be false if $array isn't an array. Technically, that usage is an error, but the behavior is kind of what you want.
Can you tell me what you have error_reporting() set to on your site? And which version of php? I read E_STRICT (which would complain about this kind of thing) has become default in PHP 5.4.
You might try turning off E_STRICT, if it's enabled, and see if that eliminates the errors. In the meantime, I'll try turning it on and see if I can reproduce this. This being Easter, though, I don't know that I'll get to it today.
Comment #5
dwillcox commentedTurning on E_STRICT, I do see your second error in theme_datereminder_manage_reminder(). I couldn't figure out how to reproduce the first, though I suspect it's the same problem.
Comment #6
christophedg commentedI don't have anything special installed for error reporting.
The database log says it's a warning, so I guess I just leave things as they are and ignore this?
My PHP version is 5.3.17.
Comment #7
dwillcox commentedIf you can find the error_reporting() call (I think it's in include/bootstrap.inc and/or index.php) and make sure E_STRICT is not set, the errors will probably go away.
I'll try to find as many of these as I can ad add checks to avoid them.
Comment #8
dwillcox commentedThere's a development branch release that I hope fixes the two E_STRICT errors that you reported. The second error (in datereminder_form.inc), was able to reproduce and verified that it now longer happens. The first error (in node_form.inc), I couldn't figure out how to reproduce. I'm pretty sure that the check I added will take care of it, but I can't confirm it.
Would you be willing to install the dev version (it's identical to 7.x-1.0 except for those to checks) and verify that the error reports go away?
Once I know it works, I'll do a new release.
Comment #9
christophedg commentedYou're right, no more notices or warnings now... Thanks for the help!
Comment #10
dwillcox commentedFixed in 7.x-1.1.
Comment #11
liza commentednope. this isn't fixed.
after much pondering of comment #1, am assuming given my set up that if you are using PANELS and create either a FIELD COLLECTION or a FIELDABLE PANEL PANE with a date field in it, this error message will not stop shouting at ya whenever you are dealing with a nodeform (either in TYPES or entering content).
i have a field collection set up by CIVICRM that has a date field in it. that's the only non-node type that can answer comment #1 in my case.
(edited cuz !clarity)
Comment #12
dwillcox commentedliza:
Rats.
OK, I know nothing about PANELS, FIELD COLLECTION or FIELDABLE PANEL PANE. I'm going to need some help here. If you can give me some fairly explicit pointers on how to reproduce this, I'd appreciate it.
I suspect that it has something to do with entities that aren't nodes, but figuring out exactly where the problem is will take some time if I have to figure it out myself.
Do you still see the problem if you turn off E_STRICT?
Comment #13
blattmann commentedI'm running into the same problem. I'm not sure how to turn off E_STRICT: I tried this in my index.php.
My content type doesn't have a field collection or use fieldable panel pane either. I am using panels, but I am getting this error while editing the node type.
Using 7.x-1.1 and PHP 5.4.8.
Comment #14
dwillcox commentedVery strange. I wonder why suddenly this cropped up again after not appearing for over 3 months. Chance? Is panels something new?
I'm re-opening this, and will poke thru code to see if I can see anything, but can't guarantee anything until I can figure out how to reproduce it myself. Pointers to what you're doing with panels, or a simple way to exercise this would be helpful.
The exact error message would help, too. The message in the original report is likely not exactly right since line numbers probably have changed.
Regarding setting E_STRICT, see comment #7.
Comment #15
dwillcox commentedI'm getting deafening silence from those who report that they've seen this exception. There are a lot of variations with panels, and I don't use panels. Without some help narrowing this down, I'm stuck.
At the vary least, can someone give some details about how they're using panels when this happens? Panel page? Panel node? Mini panel? What?
I'm about to check in some changes that may, possibly avoid the warning, hopefully without breaking intended behavior. If you aren't willing to provide information about this issue you complain about, can you at least try the upcoming development release and let me know if the problem goes away?
If I don't get any help with this, I'm going to close out the issue.
Comment #16
dwillcox commentedThere's a new development release available with (I hope) a fix. If anyone actually cares about this, please try the release and report if it solves your problem. Now is your chance.
Comment #17
blattmann commentedHi Dave,
Sorry for being so slow to reply!
I've just installed the new dev release: no change on the error (repeats eight times when editing any content type):
Notice: Undefined index: node in datereminder_alter_node_type_form() (line 102 of /xxx/sites/all/modules/contrib/datereminder/includes/node_form.inc).I've disabled panels, panels_extra_layouts, panels_ipe, flushed caches--> no change.
As well, I am not able to actually set a reminder in a node. Somehow I don't think this was the case earlier, and is likely not related.
I am going to do some more testing on a blank site with the dev release now.
Comment #18
dwillcox commentedKarl, thanks for responding.
Now this is definitely weird. I did two commits to the repository, first for an another issue, then just about an hour later another with the attempt to fix this issue. The dev release build ran about four hours later. (I don't have any control over when dev releases come out. There's some kind of periodic process that generates a release when there's been a commit.)
But for some reason the second commit didn't get into the release. That would have been fine if another build had happened later, but apparently it hasn't. So you don't have the change that I hoped would avoid this exception.
I don't understand. Some kind of race condition in the build system, perhaps? It knew there was something to build, but didn't get the latest version when it did build? I don't know.
OK, so I'm going to do another no-op commit (just change a comment somewhere) in an attempt to force another build. Can I ask you to try again when another dev release later than July 16 shows up? Sorry to be jerking you around, but I thought the fix was in there.
As to why things don't work with for you at all, now, even with panels disabled... That's a whole different oddity. I fear that something might have gotten messed up in the database. It might be necessary to uninstall Date Reminder (to clear out it's database tables) and start over. But let's wait until a new dev release is out, first.
But, hmm. Just checking... You weren't trying to request reminders as an anonymous user, were you? That isn't supported, but if the administrator tried to enabled that it caused problems. That was the other thing fixed in this dev release.
Comment #19
dwillcox commentedOK, Karl, the new July 20 dev release is there, and I've verified that the fix is there. I'd appreciate it if you could tell me whether it eliminates the exception.
Comment #20
blattmann commentedHello David,
I've just installed the new dev release and unfortunately still receive the error:
Notice: Undefined index: node in datereminder_alter_node_type_form() (line 107 of /home/XXXX/sites/all/modules/contrib/datereminder/includes/node_form.inc).I am not requesting a reminder as an anonymous user.
I don't think it's been mentioned, but I am totally unable to schedule a reminder. It makes me worry that I've messed something else up in here. Perhaps your suggestion of completely uninstalling DR is a good one. Of course I am just on a dev site and it's no problem.
Re. comment #12, I don't know if I could tell you how to reproduce it. Also, I didn’t have much luck turning off E_STRICT.
My thoughts are, since perhaps there aren't too many other people having this, I should uninstall DR and try again with this latest dev release.
Thanks again!
Comment #21
dwillcox commentedKarl -
This helps. The line number of the error I think tells me what I need to add to kill off this warning. Of course, this tells me that there are "bundles" that aren't "nodes" that have date fields in them. I think I can get rid of the exception when non-node bundles have date fields. I suppose it might be nice to support reminders for dates on other than nodes, but that would probably require other bundle-type specific hooks elsewhere. Something that's beyond my abilities right now.
I'm away from my dev environment this week, so it will be a few days before I can fix this.
I'm pretty sure that what you're seeing is a warning only and shouldn't be affecting behavior. But I understand that it's a bother.
Comment #22
dwillcox commentedOK, the latest update is in the July 26 development release.
Comment #23
dwillcox commentedI never got any feedback on this, neither positive nor negative. So the latest attempt to remove the E_STRICT errors is in 7.x-1.2.