The status message is printing '[block_type] [title] has been updated.' when a bean is created.

The status message is printing '[block_type] [title] has been created.' when a bean is updated.

20120627-ewmq6pj1c4p5tb7ggtg1anuc5g.jpg

20120627-k5ynba6xdmx7swy4c8r3aj8k3g.jpg

Comments

saltednut’s picture

Status: Active » Needs review
StatusFileSize
new598 bytes

This appears to be the offending snippet.

/**
 * @file bean.pages.inc line 288
 */
  if ($insert) {
    watchdog('bean', '@type: added %title.', $watchdog_args, WATCHDOG_NOTICE, $bean->viewURL());
    drupal_set_message(t('@type %title has been created.', $t_args));
  }
  else {
    watchdog('bean', '@type: updated %title.', $watchdog_args, WATCHDOG_NOTICE, $bean->viewURL());
    drupal_set_message(t('@type %title has been updated.', $t_args));
  }

I think there's more going on here than what I'm seeing since $input should return true when the entity is created, still here's a patch to kick this off...

Status: Needs review » Needs work

The last submitted patch, bean-status_message-1663264-2.patch, failed testing.

duellj’s picture

Status: Needs work » Needs review

#1: bean-status_message-1663264-2.patch queued for re-testing.

duellj’s picture

Status: Needs review » Needs work

Looks like test just failed with testbot. Just tested, and everything worked fine.

+++ b/includes/bean.pages.inc
@@ -286,7 +286,7 @@ function bean_form_submit($form, &$form_state) {
-  if ($insert) {
+  if (!$insert) {

This variable should probably be renamed though, since it no longer reflects what it's doing, maybe $updated?

indytechcook’s picture

Status: Needs work » Reviewed & tested by the community

Looks good. Stupid testbot

indytechcook’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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