Menu

#413 All standard fields displayed as custom fields under Windows OS

1.2
open
nobody
None
3
2016-10-28
2016-04-28
Anonymous
No

On Windows installations phpipam does not filter standard fields, what results in all table colums displayed in web interface. This seems to be an problem in fetch_standard_fields function in class.Tools.php that should return fields defined in schema.sql for filtering them. But as the schema file is created using \n as new line separator, the explode by PHP_EOL does not return \n in windows OS case.

1 Attachments

Discussion

  • Liam Bradford

    Liam Bradford - 2016-05-01

    Hi,

    I have the same issue. However becasue it shows up as a custom field the ID is always invalid when trying to create objects. Therefore its pretty much un-usable

     
  • Anonymous

    Anonymous - 2016-05-05

    Same Issue, Specs below.

    MS Server 2012R2
    IIS 8.5
    PHP 5.6.16
    MYSQL 5.6

    PHPIPAM 1.2.1

     
  • Anonymous

    Anonymous - 2016-06-10

    I am having the same issue using Windows Server 2012 with wamp. I have tried php versions 5.3.8, 5.4.3, and 5.6.16. All of the fields for user, device, vlan, vrf, and subnets appear as custom fields. The id fields don’t not increment automatically, you cannot add records with filling in all the the custom flields.

     
  • Karl

    Karl - 2016-06-10

    Found that under Windows, using PHP_EOL to read a file (probably created under Linux) doesn’t give the expected output, relative to parsing the SCHEMA.sql file.

    In the file phpipam\functions\classes\class.Tools.php, in the function fetch_standard_fields, if you replace the PHP_EOL constant with “\n”, it works.

    Here’s the original line:
    $definition = explode(PHP_EOL, $definition);

    The modified version:
    $definition = explode("\n", $definition);
    After this, all fields no longer show up as “Custom” fields on our Windows installation of PHPIPAM, and we can add records via the web interface.

    This is with version 1.2.1.

     

    Last edit: Karl 2016-06-10
  • Matthias Becher

    Matthias Becher - 2016-07-28

    I can confirm the issue on Windows Server2012 r2 and i can confirm the solution. Replace the PHP_EOL with "\n". The end-of-Line marker in SCHEMA.sql will always be an \n, no matter on which type of Server phpipam runs. So it is wrong to get the seperator for the explode() function by PHP_EOL.

    Attention!
    please not that this bug is not only in function fetch_standard_fields() on line 1015 of functions/classes/class.Tools.php
    You can find the same Bug on line 1575 in function get_field_fix() . The solution is the same.
    I searched for "PHP_EOL" in all the other code-files and i found only these 2 uses of it.

    Best regards
    Matthias Becher

     
  • Anonymous

    Anonymous - 2016-10-28
    Post awaiting moderation.

Anonymous
Anonymous

Add attachments
Cancel





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.