Skip to content
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

Sylius 1.12.8 compatibility ? #197

Closed
H4Mm3r opened this issue May 29, 2023 · 3 comments
Closed

Sylius 1.12.8 compatibility ? #197

H4Mm3r opened this issue May 29, 2023 · 3 comments

Comments

@H4Mm3r
Copy link

H4Mm3r commented May 29, 2023

Hello,

It seems that this plugin isn't working with Sylius 1.12.8.

"Next" or "Create new" button don't do anything.

Any known issue ?

Thanks by advance.

@H4Mm3r H4Mm3r changed the title Sylius 1.12.x compatibility ? Sylius 1.12.8 compatibility ? May 29, 2023
@H4Mm3r
Copy link
Author

H4Mm3r commented Jun 30, 2023

I've found this error in the browser console :

Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET https://dev/.....fr/_themes/acme/griotte-bootstrap-theme/bundles/fosjsrouting/js/router.min.js"" at /opt/sylius/dev/vendor/symfony/http-kernel/EventListener/RouterListener.php line 127

I'm using bootstrap-theme for the frontoffice but no changes on the admin bundle.

@antiseptikk
Copy link

This script should be help you

Related : Sylius/SyliusThemeBundle#91

#!/usr/bin/env bash

# Related issue : https://github.com/Sylius/SyliusThemeBundle/issues/91
#./bin/fix-theme-assets.sh

# Requirements:
#   - jq ~= 1.6

set -o errexit;
set -o nounset;
set -o pipefail;

goToRoot() {
    local currentDir;
    currentDir=$( cd "$( dirname $0 )" && pwd )

    cd "${currentDir}/../"
}

fix_theme() {
    local themeName="${1:?}"

    mkdir -p "public/_themes/${themeName}";
    unlink "public/_themes/${themeName}/bundles" 2> /dev/null || true;
    ln -s "../../../bundles" "public/_themes/${themeName}/bundles";
}

fix_themes() {
    while IFS= read -r -d '' themeConfig
    do
        local themeName;
        themeName=$(jq 'if .extra? | has("sylius-theme") then .name else null end' -r "${themeConfig}")

        if [ "null" != "${themeName}" ]; then
            fix_theme "${themeName}"
        fi
    done < <(find "./themes/"* -maxdepth 1 -name 'composer.json' -print0)
}

main() {
    fix_themes
}

goToRoot
main

@H4Mm3r
Copy link
Author

H4Mm3r commented Aug 17, 2023

This script should be help you

Related : Sylius/SyliusThemeBundle#91

#!/usr/bin/env bash

# Related issue : https://github.com/Sylius/SyliusThemeBundle/issues/91
#./bin/fix-theme-assets.sh

# Requirements:
#   - jq ~= 1.6

set -o errexit;
set -o nounset;
set -o pipefail;

goToRoot() {
    local currentDir;
    currentDir=$( cd "$( dirname $0 )" && pwd )

    cd "${currentDir}/../"
}

fix_theme() {
    local themeName="${1:?}"

    mkdir -p "public/_themes/${themeName}";
    unlink "public/_themes/${themeName}/bundles" 2> /dev/null || true;
    ln -s "../../../bundles" "public/_themes/${themeName}/bundles";
}

fix_themes() {
    while IFS= read -r -d '' themeConfig
    do
        local themeName;
        themeName=$(jq 'if .extra? | has("sylius-theme") then .name else null end' -r "${themeConfig}")

        if [ "null" != "${themeName}" ]; then
            fix_theme "${themeName}"
        fi
    done < <(find "./themes/"* -maxdepth 1 -name 'composer.json' -print0)
}

main() {
    fix_themes
}

goToRoot
main

This is exactly what I needed. It works. Thanks a lot for the solution.

I'm closing this issue as the problem comes with SyliusThemeBundle.

@H4Mm3r H4Mm3r closed this as completed Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants