Jump to content

gebeer

Members
  • Posts

    1,386
  • Joined

  • Last visited

  • Days Won

    39

Posts posted by gebeer

  1. Hello Kongondo,

    we experience a bug in Media Manager v0.1.3. When wanting to choose an image from MM in table view, after checking the red checkbox, the page inside the modal refreshes. In tile view it is working fine.

    Here's a screencast to illustrate the problem: https://www.awesomescreenshot.com/video/25972032?key=710d115a76a69bcf6642cb3ca72cfe99

    There are no errors shown in the console. Problem occurs in all browsers.

    PW v3.0.208, PHP8.1. Modules jQuery core v1.8.3, jQuery UI v1.9.6

  2. 1 hour ago, PWaddict said:

    I just installed the module on PW 3.0.229 and I chose the alt language as default but there is no redirect.

    EDIT: I had to do few more things to actually work:

    1. Add a page name to the default language on the Home page
    2. On Languages Support - Page Names module at "Default language homepage URL is same as root URL?" select "No - Root URL performs a redirect to: /name/"

    Thank you for pointing it out. I added these instructions to my original post.

    • Like 1
  3. On 2/8/2024 at 8:10 AM, gornycreative said:

    I will add it to the pile for more testing. I don't see the original problem stated in the question, just my weird related one? And I have been running the snippet in createField from our first discussion - so quite some time now.

    Thanks a lot for your help with testing. I also added the snippet and will have an eye on this for a while.

  4. 9 hours ago, gornycreative said:

    I'm not sure. The only time I get a Field returned sometimes is if I run a setMatrixItems call from ready.php and I'll get a Field::setMatrixItems does not exist or is not callable in this context error.

    I see. This problem is quite hard to debug because it is not 100% reproducable. For me it is happening only sporadicly and I didn't see it in quite a while now. Would you like to try and put that missing snippet in the createField method and see if the problem goas away?

  5. On 2/3/2024 at 3:38 AM, gornycreative said:

    Hey @gebeer remember this code that we added in our DMs?

    
          // this will auto-generate the repeater matrix template
          if ($field->type instanceof FieldtypeRepeaterMatrix) {
            $field->type->getMatrixTemplate($field);
          } elseif ($field->type instanceof FieldtypeRepeater) {
            $field->type->getRepeaterTemplate($field);
          }

    It didn't make it into the final PR I don't think.

    We inserted this at the end of createField. The original (and currently live version) only works for returning a FieldtypeRepeater I think.

    https://github.com/baumrock/RockMigrations/blob/be40ee6ae51a9f9f3ab9a9622d3acc12e069df5e/RockMigrations.module.php#L1092

    Thanks for spotting this. Did you try this and will it return the correct field type? If so, could you please make a PR? Thank you.

    • Like 1
  6. 7 hours ago, szabesz said:

    It's fine to have a diverse community, as long as people aren't using the current global warming situation to convince others to commit suicide or avoid having kids, for example. Making people afraid of partially real or made-up problems, just so those causing the fear can act like they're saving you, is a sneaky way to control you.

    So, fear not, but be skeptical and read the opinions of others as well (eg.: https://angusmac.net/category/climate-models/), and not just what the mainstream is trying to sell so hard. Those in power are not there because they want what's best for you. If they wanted that, they would not be in power in the first place.

    Although I agree on most of what you are saying, I still respect other people's views on the subject. I know this is a subject where people have very strong opinions. Since this is a programming related forum, I would like to keep those discussions out of this thread as to not pollute it. Maybe something for the beergarden?

    • Like 1
  7. 3 hours ago, Jon said:

    Iam using the following code to generate my PDF in ready.php however after adding the pdf->settings I get a 500 error, Any ideas? 

    $pdf = $modules->get('RockPdf');
    $pdf->settings([
    	'fontdata' => (new \Mpdf\Config\FontVariables())->getDefaults()['fontdata'] + [
    	  "far" => [
    		'R' => "fa-regular-400.ttf",
    		'I' => "fa-regular-400.ttf",
    	  ],
    	],
      ])
    
    	$pdf->addFont(['Roboto-Regular' => 'site/templates/fonts/Roboto-Regular.ttf',])
    
    	->load("site/templates/test-document.php", ['page' => $pages->get(1053),])
    	->save(preview: true);

     

    EDIT: which version of RockPdf are you using, free or new commercial (https://www.baumrock.com/en/processwire/modules/rockpdf/)?

    What is the error message your getting?

    Not sure you can invoke a new instance of \Mpdf\Config\FontVariables() and then use the getDefaults() method right away. In the mpdf docs they do it like

    $defaultConfig = (new Mpdf\Config\ConfigVariables())->getDefaults();
    $fontDirs = $defaultConfig['fontDir'];
    
    $defaultFontConfig = (new Mpdf\Config\FontVariables())->getDefaults();
    $fontData = $defaultFontConfig['fontdata'];
    
    $mpdf = new \Mpdf\Mpdf([
        'fontDir' => array_merge($fontDirs, [
            __DIR__ . '/custom/font/directory',
        ]),
        'fontdata' => $fontData + [ // lowercase letters only in font key
            'frutiger' => [
                'R' => 'Frutiger-Normal.ttf',
                'I' => 'FrutigerObl-Normal.ttf',
            ]
        ],
        'default_font' => 'frutiger'
    ]);

     

    • Like 1
  8. On 1/21/2024 at 4:29 PM, artfulrobot said:

    At risk of making myself unpopular, I'm a neovim user who has ethical aversion to AI. I get a great developer experience and I don't have to worry about Kernighan's law making my code buggy and hard to maintain. I am also concerned about climate change, and AI has huge carbon emissions - (re)training an LLM has been estimated to emit the equivalent CO2e as 125 round-trip flights between New York and Beijing [source]. I'm concerned that my open source code has been used against its license to train AI through github (find my stuff on codeberg or project owed gitlabs) and so now will be included in proprietary products. I'm also against having to pay subscriptions to a handful of big tech companies because this accelerates wealth inequality and erodes democracy, reducing our chances of turning the ship around before crossing the runaway climate change event horizon.

    I do not doubt AI's usefulness, or it's ability to charm and amaze or excite, I do not doubt that it can be used to save lives even (e.g. specific medical use such as identifying cancer early from scans). But I do remember how Nobel thought his invention of dynamite would be great and I'm not going to be taken in by another big tech lie about "don't be evil". We have very weak regulatory powers and a world teetering on the edge of unfathomable suffering.

    This is a post about a personal choice of text editor, and I'm not judging folx who choose Cursor (or ai plugins for neovim!) - I respect that opinions differ. But I wanted to share my opinions on my choice, too.

     

    Although I disagree with most of your views and opinions I want to thank you for sharing them. Good to have a diverse community.

    • Like 3
  9. 1 hour ago, Peter Knight said:

     

    Hi @gebeer
    I'm trying out the module and I had a few issues

    When it comes to using the Module itself, my preferred method is to allow Pick from any page

    1. I add the field to a template and I can see the tree / site structure
    2. I drill down to the page which has images and Select this
    3. Nothing happens to the placeholder thumbnail at this stage so I save the page
    4. When I return to the field, I am asked again to 'Choose a page'

    When I return to the field setup , I occasionally get an error below even though this is described in the docs as Optional
     

    I also note that in the list of possible image fields listed, the Module is not picking up any image fields.

    Thanks for reading

    Thank you for bringing this to my attention. Sorry to hear you're having trouble. This module hasn't been maintained for a long time. It definitely could need some love and care. Just a few days ago this came to my mind oout of the blue. I'm quite busy atm but hope that I can spare some time and look into this. But it may take another week or so.

    • Like 2
  10. Good to hear @bernhard, that you like Cursor so far.

    Over the course of the last year, with all that AI hype going on, I have tried several AI assistants integrated into VsCode through extensions. Copilot, Codeium, Cody, Tabby, to name the major ones. Now about 10 days ago I stumbled across Cursor and have worked with it since. Guess, I'm a bit late to the party, seeing how well it is anticipated in the Dev community.

    Cursor is integrating AI, more specifically OpenAIs GPTs, exceptionally well into the IDE. It is available when you need it, but doesn't get into your way. The UX is extremely good, in my opinion. What makes it really stand out from other solution, is the ability to build indices of your code base and give them as meaningful context to the AI. While other tools can also do this, the process of indexing and referencing the index is very efficient in Cursor. This is great for onboarding to new code bases. Cursor indexes the code and you can ask questions and, in most cases, it will be spot on with it's answers. So you very quickly find your way to the relevant parts of the code for the task at hand.

    The killer feature that I like the most and that I have not seen in any of the other tools is called Docs. With a simple command '@Docs' you point Cursor to a URL, let's say https://processwire.com/blog/posts/pw-3.0.173/ (URL Hooks documentation) and it will create a vector based index of those docs in the background. You give these docs a custom name, pwUrlHooks. Now you can reference them inside your instructions to the assistant with @pwUrlHooks. This drastically reduces hallucinations and produces very good code suggestions in most cases. I's really fun to watch the AI writing code for you that you can actually use.

    Cursor itself is free. But you only get like 50 requests a month for free. If you need more, they ask 20$/month. But you can also use your OpenAI API key to have unlimited requests. Then you pay OpenAI, of course. But at least you have the choice. And 20 bucks a month isn't that much after all for the time that this can save you.

    I'm not affiliated with them in any way. Just find it a pleasure to work with.

    EDIT: Here's a link to the docs. I couldn't find that on the Cursor website but they seem to be the official docs: https://anysphere.mintlify.app/get-started/moving-from-vsc-to-cursor

    • Like 4
  11. 1 hour ago, bernhard said:

    @gebeer I'd love to have better docs, but I don't like github wikis - that's why I built my own docs system on baumrock.com

    It reads module docs from markdown files that are stored under the /docs folder within the module. See https://github.com/baumrock/RockFrontend/tree/main/docs for example. Would be great if you could create a PR for RockMigrations that show that info on my website like here: https://www.baumrock.com/en/processwire/modules/rockmigrations/docs/deployments/

    I'm busy with client work for the next weeks, so any help is very welcome 🙂 

    Great way of managing the docs. I'll make a PR.

    • Like 1
  12. On 12/4/2023 at 5:46 PM, bernhard said:

    Hi @gebeer no, of course the page class' migrate() method can only be called once the template exists. But that is done automatically by RM if you use the createTemplate() method:

    Thank you for the explanations 🙂 Would be awesome to have this in the Wiki. Would you mind me adding it there through a PR?

    Splitting up migrations and working with multiple migrations distributed over the code base is something more advanced and not so easy to wrap ones head around. Especially when it comes to order of execution. Can we influence that? Might have overlooked it if it's in the documentation or Wiki...

  13. Hi @bernhard,

    referring to this post:

    Thank you for the detailed explanation there. I was not sure if the custom PageClass files would be called before the associated template exists and therefore the migrations would run initially. For example, I have a site/classes/MemberPage.php with migrations in it, where the migration creates the member template.

    Will the migrations be triggered before the member template even exists?

×
×
  • Create New...