Closed (fixed)
Project:
Conference Organizing Distribution Support Modules
Version:
7.x-1.x-dev
Component:
cod_session
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
16 May 2012 at 17:26 UTC
Updated:
4 Jan 2014 at 02:05 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
primerg commented- Attached patch creates a new setting in the Structure > Content types > Session > Scheduling settings
- Adds a textarea field for the admin to enter their message. an empty message means they don't want to add the notice.
- The declined message will show above the content (that's why im using the hook_node_view_alter instead). I was thinking of either using drupal_set_message or adding it inside the body. The message only accepts plain message and it is wrapped by div with class "message session-declined"
Comment #2
saltednutAlthough it applied cleanly, I was getting a PDO Exception due to hook_node_view_alter being declared twice when I applied #1
Altered the patch to combine hook_node_view functions but I am not seeing these scheduling settings on the 'Session' content type.
Comment #3
sheldonkreger commentedThe PDO Exception mentioned in #2 was caused by a mislabeled function inside of cod_session_evaluations.module: The hook_node_view_alter in that file was misnamed "cod_session_node_view_alter". So, I renamed it "cod_session_evaluations_node_view_alter", which eliminated the PDO exception.
I've also attached a screenshot of where the scheduling settings live inside of the Session content type. I can see them after I apply the patch in #1.
Comment #4
sheldonkreger commentedComment #5
dsdeiz commentedHi! Works here as well. Wasn't able to test cod_session_evaluations error though since I can't install it.
Comment #6
dsdeiz commentedGot a notice saying
Notice: Undefined index: field_accepted in cod_session_node_view_alter() (line 430 of /path/to/cod/profiles/cod/modules/cod_support/cod_session/cod_session.module).after viewing other content types.Comment #7
primerg commentedTesting the patch.
Testing
- enabled cod_bof and cod_sessions
- adding declined messages settings for bof and sessions. No error found
- testing and viewing node add for bof and sessions. No error found
- declining session proposal. No error found. The message appeared.
- declining bof proposal. FAILED. Not possible.
Because BoF doesn't have the field_status, so there is no reason to add this settings. So, I'm rethinking of the implementation of the declined message settings. Should it be at the field level settings? Thoughts?
Comment #8
dsdeiz commentedHi, field level settings seems like a better way to do it. Here's my first take with field level settings.
Comment #9
saltednut@dsdeiz thanks for the patch. In the future, please use the [project_name]-[short-description]-[issue-number]-[comment-number].patch format for patches - we have a lot of them floating around so this makes it a little easier to keep track of whats going on.
Review: patch applies cleanly. I was able to add a message if the session is declined. If no message is set, there is no message. See screenshots. Looks good/seems logical to me.
Comment #10
sheldonkreger commentedPatch in #8 is clean.
I did some additional testing. Here's a few scenarios:
Scenario 1
1. Log in as Authenticated user and create a Session.
2. Log in as Admin, edit the session, marking as "declined". Message shows.
3. Log back in as Authenticated user and visit the Session node. Message shows, and the Session is also marked as 'declined' inside of schedule info status (as in the above post)
4. Session is removed from the View at /program/sessions/proposed.
Scenario 2
1. Log in as Admin and create a Session, marking as "declined" while creating.
Works - error message shows as expected. Not sure why anyone would do this, though.
Scenario 3 - BoFs
BoFs do not have field_accepted, so this isn't going to work. Perhaps we can add field_accepted to BoFs. On the other hand, site admins can always remove BoFs manually. But this is outside the scope of this issue.
Patch in #8 looks good to me.
Comment #11
twardnw commentedBoFs are not moderated, so field_accepted would not be applicable.
Patch in #8 applies clean for me, any scenario with a declined session showed the declined message (perhaps we should establish a default for this field)
Comment #12
coltraneI think it needs a default and a theme function so the markup can be overridden.
Comment #13
dsdeiz commentedUsed "This session has been declined." as default message and added theme function.
Comment #14
dsdeiz commentedTagging.
Comment #15
primerg commentedLet's use the cod_session prefix for the theme function just to be consistent.
Comment #16
dsdeiz commentedUpdated.
Comment #17
dsdeiz commentedSorry, missed to change status.
Comment #18
mjonesdinero commentedPatch in #16 applies cleanly, it shows the decline message after updating the Status to declined
Comment #19
saltednutPatch applied cleanly and works - just one note. This is an edge case, but if for some reason the 'node-session-body' field ("Description") is left empty, this will produce an error.
Notice: Undefined index: body in cod_session_node_view_alter() (line 455 of /cod_support/cod_session/cod_session.module).This could probably be fixed using:
Comment #20
coltraneHow about
Comment #21
saltednutYes, that is better.
http://www.php.net/manual/en/language.operators.errorcontrol.php
Comment #22
saltednutPatch adds the check for
Undefined indexdescribed in comment #19Comment #23
sheldonkreger commented#22 applies cleanly.
No more error message when body field is missing.
Message displays in both scenarios listed in #10, and declined sessions do not appear on the schedule. Good work!!!
Comment #24
mjonesdinero commentedpatch on #22 applies cleanly.
Message displays as well as declined sessions don't appear on the schedule.
Comment #25
ezra-g commentedI modified the text slightly to say "This session has been declined by the session moderation team." so we provide some information about who took declined the session. This is committed. Thanks!
http://drupalcode.org/project/cod_support.git/commit/c92e13c