WordPress.org

Ready to get started?Download WordPress

Forums

Ultimate CMS
Fields tab a mix of post type and fields, striplslashes fails on Windows (7 posts)

  1. Knut Sparhell
    Member
    Posted 1 year ago #

    On Windows I get warnings on opendir() because stripslashes() does not remove backslashes. This is a WordPress bug or future enhancement that will be fixed. In the meantime this may be fatal on Windows.

    This may also be the cause the Post Type Fields tab does not work and seems very confusing.

    Use $path = rtrim( $path, '\\' ) before using a path derived from the system, and these warnings will disappear.

    http://wordpress.org/extend/plugins/ultimate-cms/

  2. XYDAC
    Member
    Plugin Author

    Posted 1 year ago #

    Integrated into the code.
    Thanks.)

    Couldn't test this. Could you please confirm?
    -Xydac

  3. Knut Sparhell
    Member
    Posted 1 year ago #

    Much better, but still:

    Warning closedir(): 5 is not a valid Directory resource on line 140 in file \wp-content\plugins\ultimate-cms\index.php
    Notice (2) Undefined variable: module_dir on line 141 in file \wp-content\plugins\ultimate-cms\index.php
    Warning (2) closedir() expects parameter 1 to be resource, null given on line 141 in file \wp-content\plugins\ultimate-cms\index.php
    Strict Accessing static property xydac_ultimate_cms::$allModules as non static on line 155 in file \wp-content\plugins\ultimate-cms\index.php
    Warning closedir(): 34 is not a valid Directory resource on line 140 in file \wp-content\plugins\ultimate-cms\index.php
    Warning closedir(): 39 is not a valid Directory resource on line 140 in file \wp-content\plugins\ultimate-cms\index.php
    Warning opendir(//wp-content/ultimate_cms/,\wordpress//wp-content/ultimate_cms/): The system cannot find the file specified. (code: 2) on line 115 in file \wp-content\plugins\ultimate-cms\index.php
    Warning opendir(//wp-content/ultimate_cms/): failed to open dir: No such file or directory on line 115 in file \wp-content\plugins\ultimate-cms\index.php

    I have removed something like "X:\MyWebsites" from the above paths before quoting.

    Remember that trailigslashit() will not remove a trailing \. Be aware of double forward slashes.

    Are you getting no warnings at all, with WP_DEBUG?

  4. XYDAC
    Member
    Plugin Author

    Posted 1 year ago #

    Am working on linux,
    Don't have a ready windows installed now.

    Made the changes and updated to new version

    Could you please check ?

    -Xydac

  5. Knut Sparhell
    Member
    Posted 1 year ago #

    Still, when I go to manage fields av a CPT:

    Warning closedir(): 5 is not a valid Directory resource on line 141 in file index.php
    Warning closedir(): 34 is not a valid Directory resource on line 141 in file index.php

    Windows accepts / as separator, but not \/.

    and a lot of Strict warnings like

    Accessing static property xydac_ultimate_cms::$dao as non static

    These last are certainly not Windows related. Are you running your own tests with WP_DEBUG?
    I run PHP 5.4 here, Linux and Windows, but I haven't tested this on Linux yet.

  6. XYDAC
    Member
    Plugin Author

    Posted 1 year ago #

    Updated..
    Kindly check.

    Yes i am running my tests with WP_DEBUG, but it seems like there is something wrong with my PHP error reporting,
    will check that by weekend..

    -Xydac

  7. Knut Sparhell
    Member
    Posted 1 year ago #

    Why are yo closing a dir three times (line 140 - 143)? The first invalidates the resource, it seems (gets an integer, random? value). The last two will fail, and it seems that muting them with @ has no effect.

    The strict issues:

    You are accessing self::cms()->dao. This means you are getting the object instance, since cms() returns it, and then setting a static property. The ->dao means that you are setting a static property as if it was a normal property of an instance. A static property belongs to the class itself, and is not a genuine object property, as a property that can be different from instance to instance. The -> constructor is for accessing properties existing in the instance (created object of the class). That's why you get strict warnings. It's a kind of "doing it wrong". It will work, I guess, but I find the strict warnings useful and educating in the PHP OOP field. Just as getting things to work is important, our understanding, as developers, of why things work, and why things might not work, is equally important. It makes us more able to maintain the code, and the code more "future proof". So, to me, strict warnings, as I get very often, tells me I am not quite understanding what I'm doing here.

    A you know very well, you access static properties by classname::property and never through $instance->property.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic