New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Path on Windows #1170

Closed
kobadg opened this Issue Dec 23, 2016 · 2 comments

Comments

Projects
None yet
4 participants
@kobadg

kobadg commented Dec 23, 2016

Expected behaviour

When trying to use the getDirectory() function from the Extensible Class (In Addon), path returns correctly with path to addon directory.

Actual behaviour

When trying to use the getDirectory() function from the Extensible Class (In Addon), path returns "".

Steps to reproduce

  1. Be on Windows
  2. create use of getDirectory() function
  3. use dd() to output with results being ""

Server configuration

Operating system: Windows 10

Web server: Apache

PHP version: 7.0.0

Statamic version: Latest

Updated from an older Statamic or fresh install: Fresh

List of installed addons: CPTheme - Creating

Fix

Change all hardcoded "/" to DIRECTORY_SEPARATOR in Path.php file (And possibly other files that have this same sort of setup?) - Example of fix.

    {
        $parts = explode(DIRECTORY_SEPARATOR, $path);
        array_pop($parts);

        return implode(DIRECTORY_SEPARATOR, $parts);
    }```

@edalzell

This comment has been minimized.

edalzell commented Dec 23, 2016

There are other methods in there that have the same issue:
replaceSlug, folder, hidden maybe, isDraft

@jackmcdade

This comment has been minimized.

Member

jackmcdade commented Mar 17, 2017

All sorted for next release.

@jasonvarga jasonvarga closed this Mar 17, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment