Author Topic: Edit a Book problem  (Read 844 times)

Offline le5

  • Coccinella
  • *
  • Posts: 10
  • Karma: +0/-0
Edit a Book problem
« on: 25 November 2015, 15:29:40 »
Hello

I just noticed, if you added authors and/or tags to a book and later you want to remove all tags or authors, it's not possible. At least on Tag and/or Author will be assigned to the book.

so i looked at the model in the backend and changed following.

models\book.php

Code: [Select]
if (parent::save($data)) {
if (isset($data['idauth'])){
$this->storeauthor($this->getState('book.id'), $data['idauth']);
}
if (isset($data['idtag'])){
    $this->storetag($this->getState('book.id'), $data['idtag']);
}
return true;
}

to

Code: [Select]
if (parent::save($data)) {
$this->storeauthor($this->getState('book.id'), $data['idauth']);
$this->storetag($this->getState('book.id'), $data['idtag']);
return true;
}

looks to like a bug... or did I oversee something

thx pawel

Offline federica

  • Amministratore
  • Delfino
  • *****
  • Posts: 1.026
  • Karma: +1/-0
Re: Edit a Book problem
« Reply #1 on: 13 December 2015, 10:34:10 »
le5, many thanks! I fixed the bugs using your code.
Al mondo ci sono 10 tipi di persone, quelli che hanno capito il codice binario e quelli che non l'hanno capito.
http://www.antivirushelp.it
stacca la spina!