Hi :)
How do you make
"Send Author a Message"
Show to Anonymous site users please?

Many Thanks for your help
Charles

Comments

aze2010’s picture

subscribing

th_tushar’s picture

Status: Active » Fixed
StatusFileSize
new9.75 KB
new1.75 KB

Hi marga123,

I have worked on the following issue and created the patch for the same. Please apply the patch for the issue to be solved. Thank you.

Regards,
Tushar

aze2010’s picture

Hi Tushar,

thank you for ypur support.
How do i apply your patches? I dont know hoq to apply it over the command shell (ubuntu).

Many greetings.

th_tushar’s picture

Hi aze2010,
There is a "patch" command provided by the ubuntu, using which you can apply the patch to a file. For the details, refer to manual pages of patch command from the terminal using "$man patch".

After applying the patch, please assign the "write message" permission to the anonymous user in people -> permissions.

Thank you.

Regards,
Tushar

aze2010’s picture

Hi Tushar,

when i want to apply the patch with "sudo patch < privatemsg.patch" i get the following message output:

patch: **** Only garbage was found in the patch input.

What i have to do to make your patches work?

Thanks in advanced.
Alex

th_tushar’s picture

Assigned: Unassigned » th_tushar
StatusFileSize
new40.63 KB
new103.08 KB

Hi Alex,
Let me give you the changes made in the file, please replace the content of original files with the content of attached files in privatemsg module. Please find he attachment for the files. Thank you.

Regards,
Tushar

aze2010’s picture

Assigned: th_tushar » Unassigned

it works!!!

Thank you very much!

I hope, this patch will be migrated into dev-version.

Many regards to you tushar!!!!
Alex

th_tushar’s picture

Hi Alex,
I too hope that is should be migrated to dev-version. Thank you.

Regards,
Tushar

aze2010’s picture

Hi Tushar,

i got one question...how can i change the redirect-path after anonymous user did send a message?
Usually it will redirect to inbox, but anonymous user dont get any inbox so the system puts a error message out "no access permission..." or recirect to login-form and so on.

Any solution to fix this for anonymous user?

Many greetings
Alex

th_tushar’s picture

Hi Alex,
Please paste the following code snippet in the "privatemsg.pages.inc" file and get your required functionality done.

<?php
/**
 * Submit callback for the privatemsg_new_anonymous form.
 */
function privatemsg_new_anonymous_submit($form, &$form_state) {
  $message = $form_state['validate_built_message'];
  field_attach_submit('privatemsg_message', $message, $form, $form_state);

  // Format each recipient.
  $recipient_names = array();
  foreach ($message->recipients as $recipient) {
    $recipient_names[] = privatemsg_recipient_format($recipient);
  }
  try {
    $message = _privatemsg_send($message);
    _privatemsg_handle_recipients($message->mid, $message->recipients);
    drupal_set_message(t('A message has been sent to !recipients.', array('!recipients' => implode(', ', $recipient_names))));
    // Only redirect on new threads.
    if ($message->mid == $message->thread_id || variable_get('privatemsg_default_redirect_reply', FALSE)) {
        $form_state['redirect'] = $_REQUEST['destination'];
    }
  }
  catch (Exception $e) {
    if (error_displayable()) {
      require_once DRUPAL_ROOT . '/includes/errors.inc';
      $variables = _drupal_decode_exception($e);
      drupal_set_message(t('Failed to send a message to !recipients. %type: !message in %function (line %line of %file).', array('!recipients' => implode(', ', $recipient_names)) + $variables), 'error');
    }
    else {
      drupal_set_message(t('Failed to send a message to !recipients. Contact your site administrator.', array('!recipients' => implode(', ', $recipient_names))), 'error');
    }
  }
}

?>

Thank you.

Regards,
Tushar

Status: Fixed » Closed (fixed)

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

ptmkenny’s picture