Is it possible to hide the event specific features when the event module is not available or the node is no event node? These features are the reminder message and autoclose option.

Comments

dww’s picture

Category: feature » bug

Yeah, that's sort of a bug in the UI, I'll agree. I'd be willing to commit a patch that fixes it even in the 5.x-1.* stable series. However, I'd be more interested in seeing this done in HEAD for the 5.x-2.* series, where we're already abstracting out the code to interface with different event back ends (event 5.x-1.*, event 5.x-2.*, date API + calendar, etc).

dww’s picture

See #289326: Add event backend API for knowing if a node/node type is untimed which should probably happen first, especially in 5.x-2.*.

dww’s picture

Version: 5.x-1.0 » 5.x-2.x-dev

This can now be done using signup_node_has_date() from #289326: Add event backend API for knowing if a node/node type is untimed. However, I think we should only do it in the 5.x-2.* series, since that's the only one that has signup_node_has_date() and I now believe this is too much of a big change in the stable 5.x-1.* series.

dww’s picture

Assigned: Unassigned » dww
Status: Active » Needs review
StatusFileSize
new8.01 KB

This ended up being slightly bigger than I hoped. The "autoclose" thing is just a site-wide setting, so we can't test with a specific node or even node type. So, I had to add yet another method to the date backend API: signup_site_has_dates(). The reminder stuff is relatively straight-forward, although it's a little bit weird how _signup_admin_form() is named and reused in various tricky ways. ;) But, cleaning all that up is outside the scope of this issue.

Anyone else care to review/test this before I commit?

Thanks,
-Derek

dww’s picture

Rerolled after recent commits to HEAD.

lut4rp’s picture

I tested this patch against the most recent HEAD version, and it gives me an error :(

patching file signup.module
Hunk #1 succeeded at 379 with fuzz 2 (offset -45 lines).
Hunk #2 succeeded at 451 (offset -52 lines).
Hunk #3 succeeded at 1194 (offset -58 lines).
Hunk #4 FAILED at 1714.
Hunk #5 FAILED at 1773.
2 out of 5 hunks FAILED -- saving rejects to file signup.module.rej
patching file signup_event_5.x-1.inc
Hunk #1 FAILED at 108.
1 out of 1 hunk FAILED -- saving rejects to file signup_event_5.x-1.inc.rej
patching file signup_event_5.x-2.inc
Hunk #1 FAILED at 86.
1 out of 1 hunk FAILED -- saving rejects to file signup_event_5.x-2.inc.rej
patching file signup_event_none.inc
Hunk #1 FAILED at 28.
1 out of 1 hunk FAILED -- saving rejects to file signup_event_none.inc.rej

After this error, I navigated to admin/settings/signup, to get the error:

Fatal error: Call to undefined function signup_site_has_dates() in /var/www/fivedrupal/sites/default/modules/signup/signup.module on line 1197
dww’s picture

Please checkout a clean copy of HEAD. I committed some stuff last night, and uploaded the new patch that I'm sure applies cleanly. Before you apply the patch, you should have the following revisions at the top of the following files:

% head -2 signup.module signup_event_*
==> signup.module <==
<?php
// $Id: signup.module,v 1.138 2008/08/02 09:14:24 dww Exp $

==> signup_event_5.x-1.inc <==
<?php
// $Id: signup_event_5.x-1.inc,v 1.5 2008/08/01 07:51:02 dww Exp $

==> signup_event_5.x-2.inc <==
<?php
// $Id: signup_event_5.x-2.inc,v 1.4 2008/08/01 07:51:02 dww Exp $

==> signup_event_none.inc <==
<?php
// $Id: signup_event_none.inc,v 1.2 2008/08/01 07:51:02 dww Exp $

If you start from there, then the patch from #5 applies cleanly:

% patch < 213239_hide_event_specific_features.5.patch 
patching file signup.module
patching file signup_event_5.x-1.inc
patching file signup_event_5.x-2.inc
patching file signup_event_none.inc

Cheers,
-Derek

lut4rp’s picture

Status: Needs review » Reviewed & tested by the community

Ugh. You're right, I checked out the DRUPAL-5 revision :)
Wokay, no issues with this too. Patch applies cleanly. Functionality working. Changed to RTBC.

dww’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD, thanks for the testing.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.