Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision a4e4f1a7

Von Jan Büren vor mehr als 10 Jahren hinzugefügt

  • ID a4e4f1a7ca65293cc7f3c45e29fc31571b4e91dd
  • Vorgänger 61421f4d
  • Nachfolger f16c5520

undefs für find_by berücksichtigen

Unterschiede anzeigen:

SL/IS.pm
492 492
       ORDER BY cp.cp_id
493 493
       LIMIT 1|;
494 494
  my $ref = selectfirst_hashref_query($form, $dbh, $query, @values);
495
  # we have no values, probably a invalid contact person. hotfix and first idea for issue #9
495
  # we have no values, probably a invalid contact person. hotfix and first idea for issue #10
496 496
  if (!$ref) {
497 497
    my $customer = SL::DB::Manager::Customer->find_by(id => $::form->{customer_id});
498
    $ref->{name} = $customer->name;
499
    $ref->{street} = $customer->street;
500
    $ref->{zipcode} = $customer->zipcode;
501
    $ref->{country} = $customer->country;
498
    if ($customer) {
499
      $ref->{name} = $customer->name;
500
      $ref->{street} = $customer->street;
501
      $ref->{zipcode} = $customer->zipcode;
502
      $ref->{country} = $customer->country;
503
    }
502 504
    my $contact = SL::DB::Manager::Contact->find_by(cp_id => $::form->{cp_id});
503
    $ref->{cp_name} = $contact->cp_name;
504
    $ref->{cp_givenname} = $contact->cp_givenname;
505
    $ref->{cp_gender} = $contact->cp_gender;
505
    if ($contact) {
506
      $ref->{cp_name} = $contact->cp_name;
507
      $ref->{cp_givenname} = $contact->cp_givenname;
508
      $ref->{cp_gender} = $contact->cp_gender;
509
    }
506 510
  }
507 511
  # remove id and taxincluded before copy back
508 512
  delete @$ref{qw(id taxincluded)};

Auch abrufbar als: Unified diff