https://twill.io logo
Join Discord
Powered by
# ❓questions
  • e

    elkex

    01/31/2023, 6:14 PM
    So I need to add a field to the database?
  • e

    elkex

    01/31/2023, 6:14 PM
    However, it saves the title and the URL, just not the media fields..
  • i

    ifox

    01/31/2023, 6:14 PM
    You need a table actually, see https://twill.io/docs/form-fields/repeater.html#using-repeater-fields
  • i

    ifox

    01/31/2023, 6:15 PM
    Repeaters saved in a JSON column won't save medias fields. you'll to setup a module for the repeated items and setup a hasMany relationship for it as documented
  • e

    elkex

    01/31/2023, 6:16 PM
    Ok
  • j

    jefsev

    01/31/2023, 9:28 PM
    Hi i upgraded to twill 3 🙂 My singletons stopped working: Route [twill.home] not defined. (View: /var/www/html/vendor/area17/twill/views/partials/navigation/_secondary_navigation.blade.php) (View: /var/www/html/vendor/area17/twill/views/partials/navigation/_secondary_navigation.blade.php) (View: /var/www/html/vendor/area17/twill/views/partials/navigation/_secondary_navigation.blade.php)
  • j

    jefsev

    01/31/2023, 9:31 PM
    The problem only seems to exist when a singleton is nested
  • j

    jefsev

    01/31/2023, 9:31 PM
    Any suggestions?
  • i

    ifox

    01/31/2023, 10:20 PM
    You should be using the TwillRoute facade to register those in Twill 3. Laravel implemented a singleton macro on the framework router so we can't use that anymore. We have twillSingleton now on Twill 2 because of that...
  • k

    kerkness

    02/01/2023, 1:27 AM
    I am just getting started with Twill and installed 3.x for a new project. I am following along with the video tutorials to get familiar. Created a simple module with a couple of fields. Added it to the admin nav and created my first record. However when I click the record to edit I get the error
    Unable to create a directory at /var/app/current/mfa-twill/app/View/Components/Twill/Blocks.
    I'm running on a local server in my lab ubuntu/nginx/mysql . I have checked and triple checked the permissions on the folder, nginx ect. Have even set the folder to
    777
    but can't seem to work around it. Feel like I'm missing something required for 3.x that is maybe not documented? Any suggestions?
  • i

    ifox

    02/01/2023, 2:03 AM
    Hi @kerkness welcome! I wouldn't recommend the videos as a reference to start with Twill 3 as they are a bit old now. Make sure you use https://twill.io/docs/3.x or GitHub for the latest documentation. We're going to update the website and docs site soon to avoid any confusion.
  • i

    ifox

    02/01/2023, 2:05 AM
    that folder shouldn't be required unless you are using the new block component classes, so if you aren't, this might be a regression in the last RC
  • i

    ifox

    02/01/2023, 2:06 AM
    I'm not reproducing in a project without that folder though so I'm not sure why you're getting this yet
  • k

    kerkness

    02/01/2023, 2:10 AM
    Thanks for the info. I created the module using cli option and did say "yes" to using blocks and pretty much all options as I'm experimenting. I'll wipe and try fresh with just the basics and refer to the 3.x docs.
  • j

    jefsev

    02/01/2023, 8:02 AM
    Ah yes thx!
  • h

    Harings Rob

    02/01/2023, 8:17 AM
    @kerkness do you still have the Unable to create a directory at error?
  • e

    elkex

    02/01/2023, 10:40 AM
    It does save the media’s field but it does not keep its media data if you resave the page in the backend.. I don’t think I fully understand how it works.. Do I have to create a whole new model just to save an entry of a media’s field..?
  • i

    ifox

    02/01/2023, 10:43 AM
    yes you do. You need to think about the repeated rows as a full blown twill module (eg if you need translated fields, a module with HasTranslations, if you need media fields, a module with HasMedias and $mediasParams configured). In your case you would create a Video module which corresponds to TeamMember in the documentation
  • e

    elkex

    02/01/2023, 10:49 AM
    All this just to save a medias field..? It does save all the text values without a problem..
  • i

    ifox

    02/01/2023, 10:49 AM
    Yes because text values are fine to save in a JSON column, but not a polymorphic relationship storing crops and such
  • e

    elkex

    02/01/2023, 10:50 AM
    Haha ok 😅
  • k

    kerkness

    02/01/2023, 11:22 AM
    Yeah so I am still getting this. I wiped and started fresh. Created a laravel project with
    composer create-project laravel/laravel mfa-twill
    Added Twill with
    Copy code
    composer require area17/twill:3.x-dev
    php artisan twill:install
    php artisan storage:link
    Then logged into admin console and tried to access my profile at
    https://content.crid.ca/admin/users/1/edit
    and get
    Unable to create a directory at /var/app/current/mfa-twill/app/View/Components/Twill/Blocks. (View: /var/app/current/mfa-twill/vendor/area17/twill/views/layouts/form.blade.php) (View: /var/app/current/mfa-twill/vendor/area17/twill/views/layouts/form.blade.php)
    The only thing I can think of is that I create the project as a sudoer user and not as
    www-data
    which is the nginx user. However that isn't an issue with any of my other laravel projects. Changing user:group of folders and paths doesn't seem to resolve the issue anyway.
  • h

    Harings Rob

    02/01/2023, 11:24 AM
    strange.. Can you make an issue on github for this? I can check it later, may be a bug I introduced.
  • k

    kerkness

    02/01/2023, 11:24 AM
    YUp. indeed. SHould I try a different branch/tag besides
    3.x-dev
    ?
  • k

    kerkness

    02/01/2023, 11:25 AM
    oh. I guess. I'll try
    3.0.0-rc3
  • k

    kerkness

    02/01/2023, 11:31 AM
    Interesting. Same error with
    3.0.0-rc3
    . I will create an issue and also try rc2
  • h

    Harings Rob

    02/01/2023, 11:43 AM
    It is trying to load the blocks from that directory, but I may just have missed a check to see if the directory even exists
  • k

    kerkness

    02/01/2023, 11:50 AM
    I created an issue. I was able to work around the error by setting both
    app
    folder and
    vendor
    folder to
    777
    permissions. Error goes away. Reverting the permissions back to
    775
    and the error DOES NOT return. So possibly just exists first load of the form
  • k

    kerkness

    02/01/2023, 11:50 AM
    Will try and create a module now with normal permissions
  • k

    kerkness

    02/01/2023, 11:57 AM
    Issue does not return after creating a basic module
1...456457458...484Latest