Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision cdbbe957

Von Bernd Bleßmann vor mehr als 1 Jahr hinzugefügt

  • ID cdbbe9575ba916740b05b8a39d9b76608669659c
  • Vorgänger dedb0f17

Gültigkeitstoken in Transaction abfragen und löschen ("neue" Controller)

Unterschiede anzeigen:

SL/Controller/Order.pm
2120 2120
sub save {
2121 2121
  my ($self) = @_;
2122 2122

  
2123
  my $validity_token;
2124
  if (!$self->order->id) {
2125
    $validity_token = SL::DB::Manager::ValidityToken->fetch_valid_token(
2126
      scope => SL::DB::ValidityToken::SCOPE_ORDER_SAVE(),
2127
      token => $::form->{form_validity_token},
2128
    );
2129

  
2130
    return [t8('The form is not valid anymore.')] if !$validity_token;
2131
  }
2132

  
2133 2123
  $self->recalc();
2134 2124
  $self->get_unalterable_data();
2135 2125

  
......
2160 2150
  }
2161 2151

  
2162 2152
  $db->with_transaction(sub {
2153
    my $validity_token;
2154
    if (!$self->order->id) {
2155
      $validity_token = SL::DB::Manager::ValidityToken->fetch_valid_token(
2156
        scope => SL::DB::ValidityToken::SCOPE_ORDER_SAVE(),
2157
        token => $::form->{form_validity_token},
2158
      );
2159

  
2160
      die $::locale->text('The form is not valid anymore.') if !$validity_token;
2161
    }
2162

  
2163 2163
    # delete custom shipto if it is to be deleted or if it is empty
2164 2164
    if ($self->order->custom_shipto && ($self->is_custom_shipto_to_delete || $self->order->custom_shipto->is_empty)) {
2165 2165
      $self->order->custom_shipto->delete if $self->order->custom_shipto->shipto_id;

Auch abrufbar als: Unified diff