Menu

Expire date won't set on creation of vouchers

Help
derde
2019-04-26
2019-04-26
  • derde

    derde - 2019-04-26

    Hi everybody,

    since i update to r2270 over subversion, it is not possible anymore to set a expire date on creating a voucher (or many of them). I can only alter every single voucher and set then a expire date.

    Is there anybody to give me a hint where i can debug this? It seems a problem of the javascript but i am not sure.

    Cio Christoph

     
  • derde

    derde - 2019-04-26

    Hi everybody,

    the woraround for this is to edit the VouchersController.php under cake3/rd_cake/src/Controller at about line 316

            //Get the owner's id
            if($this->request->data['user_id'] == '0'){ //This is the holder of the token - override '0'
                $this->request->data['user_id'] = $user_id;
            }
    
            //___Two fields should be tested for first___:
            if(array_key_exists('activate_on_login',$this->request->data)){
                $this->request->data['activate_on_login'] = 1;
            }
    
            if(array_key_exists('never_expire',$this->request->data)){
                $this->request->data['never_expire'] = 1;
            }
            //____ END OF TWO FIELD CHECK ___       
    
            // $check_items = array(
            //  'activate_on_login',
            //    'never_expire'
            // );
    
            //foreach($check_items as $i){
            //    if(isset($this->request->data[$i])){
            //        $this->request->data[$i] = 1;
            //    }else{
            //        $this->request->data[$i] = 0;
            //    }
            // }
    

    I take the snippet from the VouchersController.php under the cake2-path.

    Regards
    Christoph

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.