Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Pkg_edit bug?

    Development
    3
    5
    3.1k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      dvserg
      last edited by

      Default url for pkg_edit contains
      /pkg_edit.php?xml=package_name.xml&id=0

      Example from package.xml

      
       <tab><text>Package text</text>
          <url>/pkg_edit.php?xml=package_name.xml&id=0</url></tab> 
      
      

      But if  '&id=0' is absent ('<url>/pkg_edit.php?xml=package_name.xml</url>'),
      then in config.xml for this package builds multiple 'config' sections

       <packagename><config>...</config> 
       <config>...</config></packagename> 
      

      Really must be one section

      May be need correct this part?
      pkg_edit.php line 69

      
      $id = $_GET['id'];
      if (isset($_POST['id']))
      	$id = $_POST['id'];
      
      

      to this (or near) - define $id=0 as default, if them not in url

      
      $id = $_GET['id'];
      if (isset($_POST['id']))
      	$id = $_POST['id'];
      else
                   $id=0; // or $id='0'; ??
      
      

      SquidGuardDoc EN  RU Tutorial
      Localization ru_PFSense

      1 Reply Last reply Reply Quote 0
      • F
        fernandotcl
        last edited by

        That's not a bug, it's a feature. ;-)

        No really, it's on purpose. When you click in a "+" icon in a pkg.php page, you'll be redirected to pkg_edit.php without id=X, which means exactly "add a new config item". It's not pretty, but then new XML stuff should use cg2 instead anyways.

        1 Reply Last reply Reply Quote 0
        • D
          dvserg
          last edited by

          @fernandotcl:

          That's not a bug, it's a feature. ;-)

          No really, it's on purpose. When you click in a "+" icon in a pkg.php page, you'll be redirected to pkg_edit.php without id=X, which means exactly "add a new config item". It's not pretty, but then new XML stuff should use cg2 instead anyways.

          About pkg.php i know  ::)
          What this - cg2? This mean php module for package in next version pfSense? I right understand?

          SquidGuardDoc EN  RU Tutorial
          Localization ru_PFSense

          1 Reply Last reply Reply Quote 0
          • S
            sullrich
            last edited by

            http://wiki.pfsense.com/wikka.php?wakka=CoreGUI2Introduction

            1 Reply Last reply Reply Quote 0
            • D
              dvserg
              last edited by

              Ohm..  :D
              Thx.

              SquidGuardDoc EN  RU Tutorial
              Localization ru_PFSense

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.