test
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • hcharly Friend
    #160123

    Hello,

    Problem noticed developing at localhost with the latest version of JA Voice, but is the same at your demo site:

    With “Tag settings” enabled, users are supposed to input tags separated by a comma (,)
    Doing so, I found out that only the last provided TAG will be added.

    What is the fix for that?
    Thanks and Regards.
    -Charles

    nghiatd Friend
    #376602

    Hello,

    The bug has been reported: http://pm.joomlart.com/browse/JAVOICE-386
    we will release with this bug fixed in next version.
    Please follow my guide to fix out it:
    Open file componentscom_javoicecontrollerstags.php then find the code:

    function addnew(){
    $tags = JRequest::getVar("taglist", "");
    if($tags){
    $list = explode(",", $tags);
    $model = & $this->getModel('tags');
    $post = array();
    $tags = "";
    $objects = array ();
    $helper = new JAVoiceHelpers ( );
    foreach ($list as $i=>$item){
    $id = $model->checkExistTag($item);
    if(!$id){
    $post["name"] = $item;
    $post["published"] = 1;
    $post["id"] = 0;
    if($i==0){
    $tags .= $post["name"];
    }else{
    $tags .= ",".$post["name"];
    }
    $id = $model->save($post,1);
    $k=0;
    $object [$k] = new stdClass ( );
    $object [$k]->id = $id;
    $object [$k]->type = $item;
    $k++;
    }else{
    $k=0;
    $object [$k] = new stdClass ( );
    $object [$k]->id = $id;
    $object [$k]->type = $item;
    $k++;
    }
    }
    $helper = new JAVoiceHelpers ( );
    echo $helper->parse_JSON_new ( $object );
    exit ();
    }else{
    exit();
    }
    }

    then replace it to:

    function addnew(){
    $tags = JRequest::getVar("taglist", "");
    if($tags){
    $list = explode(",", $tags);
    $model = & $this->getModel('tags');
    $post = array();
    $tags = "";
    $objects = array ();
    $helper = new JAVoiceHelpers ( );
    $k=0;
    foreach ($list as $i=>$item){
    $id = $model->checkExistTag($item);
    if(!$id){
    $post["name"] = $item;
    $post["published"] = 1;
    $post["id"] = 0;
    if($i==0){
    $tags .= $post["name"];
    }else{
    $tags .= ",".$post["name"];
    }
    $id = $model->save($post,1);

    $object [$k] = new stdClass ( );
    $object [$k]->id = $id;
    $object [$k]->type = $item;
    $k++;
    }else{

    $object [$k] = new stdClass ( );
    $object [$k]->id = $id;
    $object [$k]->type = $item;
    $k++;
    }
    }
    $helper = new JAVoiceHelpers ( );
    echo $helper->parse_JSON_new ( $object );
    exit ();
    }else{
    exit();
    }
    }

    Best Regards.

    hcharly Friend
    #376762

    Yes nghiatd. Fixed
    Thanks and Regards.
    -Charles

Viewing 3 posts - 1 through 3 (of 3 total)

This topic contains 3 replies, has 2 voices, and was last updated by  hcharly 13 years, 10 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum