Zikula: A Flexible Open Source Content Management System
home | forum | international support | contact us

Support Forum

Start ::  Extensions and Distributions Support ::  Modules ::  Mod Dev Q: Not deleteing...

Moderated by: Support Team

Bottom
Mod Dev Q: Not deleteing...

  • Link to this postingPosted: 22.05.2004, 08:48
    Profile Homepage
    mhalbrook
    rank:
    Legend Legend
    registered:
     October 2001
    Status:
    offline
    last visit:
    28.08.08
    Posts:
    6481
    For some reason, when confirmed, this is not sending the value of $asn through. It's showing fine when it's first loaded, but not passing through on confirm..

    Code
    function pnSerialTracker_user_delete( $args )
    {
                     list( $asn, $confirmation ) = pnVarCleanFromInput( 'asn', 'confirmation' );
                     extract( $args );
                     $output = new pnHTML();
                     $output->SetInputMode( _PNH_VERBATIMINPUT );
                     $output->Text( pnSerialTracker_usermenu() );
                     $output->SetInputMode( _PNH_PARSEINPUT );
                     if ( !pnModAPILoad( 'pnSerialTracker', 'user' ) )
                    {
                                     pnSessionSetVar( 'errormsg', _LOADFAILED );
                                     return $output->GetOutput();
                                     }
                    if ( empty( $confirmation ) )
                    {
                                     $output->Title( _PNSTDELETEITEM );
                                     $output->ConfirmAction( _PNSTSURE . $asn ,
                                                     pnModURL( 'pnSerialTracker',
                                                                     'user',
                                                                     'delete ' ),
                                                     _CANCELITEMDELETE,
                                                     pnModURL( 'pnSerialTracker',
                                                                     'user',
                                                                     'do_search',
                                                                     array( 'loc' => 1,
                                                                                     'term' => pnUserGetVar( uname ) )
                                                                     ) );
                                     return $output->GetOutput();
                                     }
                    if ( !pnModAPILoad( 'pnSerialTracker', 'user' ) )
                    {
                                     $output->Text( _LOADFAILED );
                                     return $output->GetOutput();
                                     }
                    if ( pnModAPIFunc( 'pnSerialTracker',
                                                     'user',
                                                     'delete_item',
                                                     array( 'asn' => $asn ) ) )
                    {
                                     pnSessionSetVar( 'statusmsg', _PNSTITEMDELETED );
                                     }
                    pnRedirect( pnModURL( 'pnSerialTracker',
                                                                     'user',
                                                                     'do_search',
                                                                     array( 'loc' => 1,
                                                                                     'term' => pnUserGetVar( uname ) )
                                                                     ) );
                     return true;
                    }
  • Link to this postingPosted: 26.05.2004, 06:55
    Profile Homepage
    mhalbrook
    rank:
    Legend Legend
    registered:
     October 2001
    Status:
    offline
    last visit:
    28.08.08
    Posts:
    6481
    Anyone?
  • Link to this postingPosted: 26.05.2004, 09:25
    Profile
    r3ap3r
    rank:
    Helper Helper
    registered:
     January 2004
    Status:
    offline
    last visit:
    22.02.08
    Posts:
    381
    I have no clue what this module is, but the first thing I would ask is why you are loading the API twice. Then I would want to look at the code that called the user_delete function to see if it is passing a value for asn that is overwriting the value that you get from pnVarCleanFromInput() when you do the extract($args); Then I would want to see the delete_item function to make sure that it wasn't that function that was losing the value.

    Right off hand it looks like this function should work.

    -Chris
  • Link to this postingPosted: 26.05.2004, 09:29
    Profile
    r3ap3r
    rank:
    Helper Helper
    registered:
     January 2004
    Status:
    offline
    last visit:
    22.02.08
    Posts:
    381
    Take that back. Change this:
    Code
    pnModURL( 'pnSerialTracker',
                                                      'user',
                                                      'delete ' ),

    To be:
    Code
    pnModURL( 'pnSerialTracker',
                                                      'user',
                                                      'delete ',
                                                     array('asn'=>$asn) ),

    inside this block:
    Code
    if ( empty( $confirmation ) ) { }


    -Chris
  • Link to this postingPosted: 26.05.2004, 19:24
    Profile Homepage
    mhalbrook
    rank:
    Legend Legend
    registered:
     October 2001
    Status:
    offline
    last visit:
    28.08.08
    Posts:
    6481
    That took care of part of it, totally missed that there was also a space after delete, and that was also a problem.

Start ::  Extensions and Distributions Support ::  Modules ::  Mod Dev Q: Not deleteing...

Main Menu

Extensions Database

Documentation

Development

Login





 


 Log in Problems?
 New User? Sign Up!

Donate to Zikula