Skip to:

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#4225 closed defect (bug) (fixed)

Messages - View/1/ reply to: results in undefined index /headers sent

Reported by: hnla's profile hnla Owned by:
Milestone: 1.6 Priority: normal
Severity: minor Version: 1.2
Component: Messages Keywords: has-patch
Cc: hnla


Not sure why this is occurring (BP 1.6), but sending reply to a message results in undefined index 'subject' in bp-messages-actions.php line 35.

line 35 checks for a $_POSTsubject?

if ( messages_new_message( array( 'thread_id' => $thread_id, 'subject' => $_POSTsubject?

/single/messages/single.php sends no 'subject'

<input type="hidden" id="thread_id" name="thread_id" value="<?php bp_the_thread_id(); ?>" />
<input type="hidden" id="messages_order" name="messages_order" value="<?php bp_thread_messages_order(); ?>" />

To correct this pro tem I've had to add:

<input type="hidden" id="thread_subject" name="subject" value="<?php bp_the_thread_subject() ?>" />

Haven't tested earlier versions, but checked the two files in and they appear same as 1.6

Feel as though I've overlooked something somewhere

Attachments (2)

4225.trunk.01.patch (859 bytes) - added by r-a-y 12 years ago.
4225.1.5-branch.01.patch (830 bytes) - added by r-a-y 12 years ago.

Download all attachments as: .zip

Change History (9)

#1 @r-a-y
12 years ago

  • Keywords needs-testing added
  • Severity changed from major to minor

I can't duplicate this bug. Testing on r6057. Can anyone else?

#2 @hnla
12 years ago

:) You can replicate it if you disable JS - yes I had forgoten I had disabled it *sigh*

However this exposes a weakness, in order to send messages you must have JS enabled?? why? shouldn't be the case really as that's not progressive enhancement.

If I leave the hidden input I added above to pass the subject line over with JS enabled it appears to not cause any upset but does mean there's a fallback.

#3 @r-a-y
12 years ago

  • Keywords has-patch added; needs-testing removed
  • Version set to 1.2

#4 @r-a-y
12 years ago

Hey hnla, duplicated! :)

Instead of adding the hidden input field, I've opted to add an empty subject check for messages_new_message() in messages_action_view_message().

Great that you're testing BP without JS enabled!

#5 @DJPaul
12 years ago

  • Milestone changed from Awaiting Review to 1.6

Thanks guys

#6 @djpaul
12 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [6059]) Prevent PHP Notice when sending private messages with javascript disabled. Fixes #4225, props hnla and r-a-y

#7 @hnla
12 years ago

Great, looks good to me I'll test the patch later your approach. ray makes, more sense than adding a hidden input.

Yes try and test without JS as much as possible to see how things hold up

Note: See TracTickets for help on using tickets.