BoltTranslate / Translate

Provides translation for contenttypes.
Other
43 stars 38 forks source link

Composer install breaks the language switcher in the backend #21

Closed flrvt closed 8 years ago

flrvt commented 8 years ago

I am setting up a Bolt site, and just installed the Translate extension. As discussed in Slack, the issue I'm encountering probably is because of the composer install.

For completeness, this a part of what my contenttypes.yml looks like:

pages:
    name: Pages
    singular_name: Page
    class: \Bolt\Extension\Animal\Translate\Content\LocalizedContent
    fields:
        locale:
            type: locale
            group: content
        title:
            type: text
            class: large
            required: true
            isTranslatable: true
            error: "You must give your page a title."
            info: "This title is usually not displayed on the page, but is used throughout the CMS, and when no SEO title is specified."
        slug:
            type: slug
            uses: title
            info: "This is the text that will be used in the URL of this page."
            error: "You must give your page a slug."
        template:
            type: templateselect
    record_template: page_basic.twig
    icon_many: "fa:bookmark"
    icon_one: "fa:bookmark"

I followed all the required steps in the README of this extension, but when I switch language on a page in the back-end, the browser points me to a Whoops page with url /bolt/async/translate/get:

Bolt\Exception\PermissionLexerException thrown with message "Unexpected character ':' while parsing query contenttype::edit"

Stacktrace:
#10 Bolt\Exception\PermissionLexerException in /Volumes/128GB/Projecten/projectx/vendor/bolt/bolt/src/PermissionParser.php:224
#9 Bolt\PermissionParser:lex in /Volumes/128GB/Projecten/projectx/vendor/bolt/bolt/src/PermissionParser.php:150
#8 Bolt\PermissionParser:run in /Volumes/128GB/Projecten/projectx/vendor/bolt/bolt/src/Permissions.php:535
#7 Bolt\Permissions:isAllowed in /Volumes/128GB/Projecten/projectx/vendor/bolt/bolt/src/Users.php:1169
#6 Bolt\Users:isAllowed in /Volumes/128GB/Projecten/projectx/extensions/vendor/animal/translate/src/Controller/AsyncController.php:35
#5 Bolt\Extension\Animal\Translate\Controller\AsyncController:getTranslationAction in <#unknown>:0

When loading a page in the back-end, this error is logged in the browser console:

GET http://projectx.dev/extensions/vendor/animal/translate/assets/css/field_locale.css 404 (Not Found)
GET http://projectx.dev/extensions/vendor/animal/translate/assets/js/field_locale.js 404 (Not Found)

These files do not exist on the webserver as I am using an install outside of the webroot.

Details

GwendolenLynch commented 8 years ago

The composer.json needs a ""bolt-assets" : "", parameter in the "extras" section

Something like:

"bolt-assets" : "assets",

Only problem being is that Twig assets are mixed in with web assets currently.