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

    Rudy

    07/12/2021, 3:59 PM
    yes
  • i

    ifox

    07/12/2021, 3:59 PM
    can you share the rest of the error? in which table is it looking for that column?
  • i

    ifox

    07/12/2021, 4:03 PM
    hmm ok. Do you see that column in the database?
  • r

    Rudy

    07/12/2021, 4:08 PM
    ok, nevermind.. i forgot add this columns to model in translatedAtt
  • s

    sebastianlenton

    07/13/2021, 6:50 PM
    Hello, I've upgraded my Twill site from 1.2.2 to 2.4 and seem to have a problem. On one of my module edit screens, if I save the existing modules blocks it fails with the following error in the browser console:
    message: "Undefined index: endpointType", exception: "ErrorException", file: "/Users/sebastianlenton/Sites/order/vendor/area17/twill/src/Models/Behaviors/HasRelated.php"
    (can provide more if it helps). But if I delete them all and add some new ones with the same content, it saves successfully- any ideas? am I missing something obvious here? 🙂
  • p

    pboivin

    07/13/2021, 7:14 PM
    Hey @User , is this something you can repeat? You get the error every time you try to update any existing record from that module?
  • s

    sebastianlenton

    07/13/2021, 7:15 PM
    Yes.
  • p

    pboivin

    07/13/2021, 7:15 PM
    And you also get the error when creating new records?
  • s

    sebastianlenton

    07/13/2021, 7:16 PM
    I might not have said the right thing actually- I'm talking about a load of blocks on an edit screen.
  • s

    sebastianlenton

    07/13/2021, 7:16 PM
    If I start from what was there before I upgraded, and add new ones, it errors.
  • s

    sebastianlenton

    07/13/2021, 7:16 PM
    If I delete some and add a new one it errors also. But if I delete all of them and add a new one it succeeds
  • p

    pboivin

    07/13/2021, 7:17 PM
    I see, thanks for clarifying. Out of curiosity, what type of fields are in your blocks?
  • i

    ifox

    07/13/2021, 7:18 PM
    hey @sebastianlenton nice to see you here!
  • s

    sebastianlenton

    07/13/2021, 7:18 PM
    Thanks, wasn't sure where else to turn! 😅
  • i

    ifox

    07/13/2021, 7:19 PM
    Sebastian is a Twill OG
  • i

    ifox

    07/13/2021, 7:20 PM
    You were one of the first users outside of A17 like 3-4 years ago now
  • s

    sebastianlenton

    07/13/2021, 7:20 PM
    All sorts of fields but they do all have browsers in actually
  • i

    ifox

    07/13/2021, 7:20 PM
    yeah it's a browser thing
  • s

    sebastianlenton

    07/13/2021, 7:20 PM
    @ifox you probably know which site I'm working on... 🙂
  • p

    pboivin

    07/13/2021, 7:20 PM
    Cool, that was my next question 😄
  • i

    ifox

    07/13/2021, 7:21 PM
    in twill 1 browsers were saved in the blocks content json
  • i

    ifox

    07/13/2021, 7:23 PM
    you might need to write a small data migration on blocks that include a browser field. i can look into this closer later today.
  • s

    sebastianlenton

    07/13/2021, 7:26 PM
    That would be brilliant, thanks!
  • s

    sebastianlenton

    07/13/2021, 8:57 PM
    @ifox @pboivin looks like I've managed to fix it! I didn't spot the
    related
    table before- I had a look and wrote a crummy little script to MacGyver the data in. 😂 All saving now- thanks very much for your help, both!
  • p

    pboivin

    07/13/2021, 9:00 PM
    Awesome! I'm curious to know about your script, I have a passion for crummy little ones 🙂
  • s

    sebastianlenton

    07/13/2021, 9:03 PM
    Too embarrased to tell you! 😅 Wasn't sure how to do it using a migration or whatever so grabbed the data using the DB facade- executed it in Tinker...
  • p

    pboivin

    07/13/2021, 9:05 PM
    Oh yeah, love it! I can't count the times I've used Tinker to quickly seed/transfer data over...
  • a

    andrewsamuelhan

    07/14/2021, 8:16 AM
    Hi, I wanna share something about twill handling repeaters. When I read the function in Repositories\Behaviors\updateRepeater(), it automatically defined the foreign key as {relation_column_name}_id and the function coming from getForeignKey(). So due to I've my own standard about databases foreign key name, When I tried to save using updateRepeater, it shows Error on Submission. Then my solution is to set a custom updateRepeater's function in each my repositories to use custom foreign key name instead using predefined getForeignKey(). Maybe do you have any better idea? Or maybe twill would like to consider this method as new update? So we can set our custom foreign key name on function parameter?
  • i

    ifox

    07/14/2021, 10:45 AM
    interesting, thanks for sharing. First you can create yourself a trait or parent class to avoid putting your custom update repeater in every repository. What about directly updating getForeignKey on your models?
  • v

    void

    07/14/2021, 2:07 PM
    afaik the datepicker in Twill doesn't mention a blocked dates option
1...616263...484Latest