The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Having problem with calling Api2 Module:ZoneEdit

Discussion in 'cPanel Developers' started by mysteryosly, Aug 21, 2012.

  1. mysteryosly

    mysteryosly Registered

    Joined:
    Aug 21, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Hello , im currently trying to call api2 module ZoneEdit function remove/add_zone_record but im getting the following error:
    [ZoneEdit::remove_zone_record ] Encountered error in ZoneEdit::remove_zone_record : API2: Could not locate function Cpanel::ZoneEdit::api2_remove_zone_record !
    _______________________________________________________________
    Encountered error in ZoneEdit::add_zone_record : API2: Could not locate function Cpanel::ZoneEdit::api2_add_zone_record !
    warn [cpanel] Unable to run [Cpanel::ZoneEdit::api2_remove_zone_record (2/8)]; () at /usr/local/cpanel/Cpanel/Api2/Exec.pm line 115
    __________________________________________________
    I've tried this little plugin in an older cpanel version it worked , without problems to add and remove zone records .
    Currently im testing this on the latest cpanel version : 11.32.3 (build 23) and im getting those errors .
    Could you gimme some orientation , what can i be doing wrong ?
    I am testing this with normal account , that have DNS editors (simple/advanced) enabled . Yet in my plugin i cant execute those commands .

    I am using livephp for calls .
    A view of my call :
    $cpanel = new CPANEL();
    $cpanel->api2('ZoneEdit','remove_zone_record ',array("domain"=>"$domain","line"=>"$line"));
    $cpanel->api2('ZoneEdit','add_zone_record',array("domain"=>"$domain","name"=>"$newrecord_name","type"=>"$type","ttl"=>"$ttl","$address_var"=>"$address","class"=>"IN"));

    Thanks in advance.
     
  2. mysteryosly

    mysteryosly Registered

    Joined:
    Aug 21, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    bumpszeeers
     
  3. KostonConsulting

    KostonConsulting Well-Known Member

    Joined:
    Jun 17, 2010
    Messages:
    255
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    San Francisco, CA
    cPanel Access Level:
    Root Administrator
    You need to remove the trailing space in the name of the function.

    Code:
    'remove_zone_record '
    
    should be

    Code:
    'remove_zone_record'
    
     
Loading...

Share This Page