Jump to content

flydev πŸ‘ŠπŸ»

Members
  • Posts

    1,119
  • Joined

  • Last visited

  • Days Won

    34

Everything posted by flydev πŸ‘ŠπŸ»

  1. @bernhard sorry, forgot to include the link, edited the post.
  2. @bernhard you might want to take a look at this medium article, section mic/voice and OBS settings (I hope you are already using this one: https://github.com/obsproject/obs-studio/wiki).
  3. I think that some of your questions is just a matter of taste from every dev. Throwing my tastes below. I am personnaly not used to speak english with other people, and that's the most "complicated" thing to me when watching youtube video, anyway your accent is very good - I understand everything πŸ₯–πŸ‘ It doesn't matter, everything need to be explained and you did very well. Taking time for learning is just required. (watched till the end last saturday with a coffee). Put this on the right-bottom corner, absolutely ! Both, make the video after writing the readme 😁. I always end up on the video, after reading a readme, and if the readme only contain the link of the video, I feel very sad. Perhaps the sound of the voice should be a little higher pitched. No music for cencentration ! Or in the intro/Outro only ! πŸ•Ί You can be proud, thanks for it πŸ‘πŸš€ Oh yes !
  4. You must write: `catch(\Exception $e)` as the object must be an instance of the Exception class or of a subclass (see/mean inheritance here) of the Exception class. A must read is this following blog post on Microsoft and then come back with questions if still any πŸ‘πŸ‘‡ https://docs.microsoft.com/en-us/archive/blogs/kcwalina/how-to-design-exception-hierarchies Excerpt from Krzysztof Cwalina (software architect) :
  5. A dumb question, disk or partition full ? You could also look at this answer on dba.stackexchange for identifying the issue: https://dba.stackexchange.com/a/48897/170766
  6. Just a thought before we go further. When is the 404 page displayed? On the index page (frontend) or only the admin page? If it's the second case, the .htaccess file is probably missing or the admin page entered may not be the right one (this can be checked in the database, table pages, id 2, column name) Otherwise, in the first case, check that you uploaded all the required processwire files (at least the index.php which will throw an error if the setup is ok, or as @DV-JF double or triple check your apache configuration on xampp.
  7. Ok, then to fix the error, in `ProcessLoginHistory` date format setting, put : Y-m-d H:i:s Then ping @teppo πŸ™‚
  8. Ok then, first make a backup of the database, just in case, and please show us the full `call trace` logs shown on the tracy error (below the first error screen panel), along the ProcessWire version and MySQL version. You can also try to click on `Module Refresh` to see what happen. --- I didn't saw in first instance that the error was from the module `ProcessLoginHistory`, there must be a heck between the two modules. Will check. @Roych can you share the settings of `ProcessLoginHistory` and `ProcessLoginHistoryHooks` please ?
  9. To try it, you can just create a dummy page with page's name `hello` and paste the whole code in `ready.php` πŸ™‚
  10. @Roych How did you changed the settings ? By hands or using the date picker ? Anyway, you can check if a weird date got saved in the module tables in the database. Open your database tool like `PHPMyAdmin` and check the following two tables : field_user_login_enabled_from field_user_login_enabled_until The values should be something like : 2022-08-23 00:00:00
  11. Check and try the following, I think the link provided all the infos. /// get and mod inputfield submit $wire->addHookBefore('InputfieldSubmit::render', function($event) { /// get page being edited from from query string $id = (int) $this->input->get->id; // ⚠️ sanitize it, do not trust your xss ninja admins $page = $this->pages->get($id); /// i.e. exit if page name is not 'hello' if($page->name !== 'hello') return; /// get the object the event occurred on $submit = $event->object; /// make sure to target the `submit save` button (it could be more than one button) $name = $submit->attr('name'); if($name !== 'submit_save') return; /// change the button's label (attribute: value) $submit->attr("value", "Foobar"); }); /// mod the inputfield submit dropdown $wire->addHookAfter('ProcessPageEdit::getSubmitActions', function($event) { $actions = $event->return; // array actions /// get page being edited from event's object $page = $event->object->getPage(); /// i.e. exit if page name is not 'hello' if($page->name !== 'hello') return; $actions['to_the_moon'] = [ 'value' => 'to_the_moon', 'icon' => 'moon-o', 'label' => '%s + Go Moon πŸš€', // Save + Go Moon 'class' => '', ]; $event->return = $actions; }); /// process the new action dropdown $wire->addHookAfter('ProcessPageEdit::processSubmitAction', function($event) { $action = $event->arguments(0); // action name, i.e. 'cache' if($action === 'to_the_moon') { $event->message("Your page was rocketed to the moon πŸš€πŸŒš", "nogroup"); } }); /// remove all the dropdown action but keep our new one $wire->addHookAfter('ProcessPageEdit::getSubmitActions', function($event) { $actions = $event->return; // array of actions, indexed by name /* bd($actions) πŸ‘‡ 'exit' => array 'view' => array 'add' => array 'next' => array */ /// remove all action, let just keep our `to the moon` action foreach($actions as $action) { $name = $action['value']; if($name === 'to_the_moon') continue; unset($actions[$name]); } $event->return = $actions; }); /// bonus - add a second button on the current edit page $this->addHook('ProcessPageEdit::buildForm', function($event) { /// get page being edited from from query string $id = (int) $this->input->get->id; // ⚠️ sanitize it, do not trust your xss ninja admins $page = $this->pages->get($id); /// i.e. exit if page name is not 'hello' if($page->name !== 'hello') return; /// quite self explanatory $href = $this->config->urls->admin."page/edit/?id=$id&to=the_moon"; $field = $this->modules->get('InputfieldButton'); $field->attr('id+name', 'input_moon'); $field->attr('class', $field->class); $field->attr('value', 'To the moon πŸš€'); $field->attr('href', $href); $event->return = $event->return->append($field); });
  12. Ok, then if you got redirected, it's a good thing. If you code the url, even hardcoded, you should be redirected to the checkout, but not in the admin.
  13. Just an idea as I dont have module v2. Maybe Kongondo will have a better solution. You can try adding the hx-redirect header to the request and htmx will redirect to the value of the header, eg, with custom markup: <div hx-post="{$config->urls->root}padloper/add/" hx-headers='{"hx-redirect": "{$config->urls->root}pad/checkout/"}'>Add to Cart</div> More infos: https://docs.kongondo.com/start/customise-markup.html#padloper-partial-templates-snippets https://htmx.org/attributes/hx-headers/ https://htmx.org/docs/#response-headers
  14. I have a better feeling with Go language and the features / compliance of Fathom is for sure better for professionnal (yeah well that's their job), see here, less headhash once you are ready to pay and let them manage the cons. Thanks for sharing pwired.
  15. I was looking for a self-hosted analytics solution as GA is declared illegal by the CNIL in France. Looking again the module FathomAnalytics made by @Craig, I jumped on Fathom website to compare the lite and full version, quite interesting, but damn things can turn rudes... https://usefathom.com/blog/illegal-analytics https://usefathom.com/blog/6monthsjail https://isgoogleanalyticsillegal.com/
  16. Then reason is the following: As you are declaring $this->var in the init() method, then you are declaring it in the earliest possible point of Wireframe execution, and only available after the instanciation (keep in mind that init() is called multiple times.), and then, the controller object set the $var in the $view scope which is a property of the controller, that's why the variable is available on $this->view object. A contrario, if you was declaring the variable as an object property (like @Pixrael just suggested) then the $this->var would have been available in your test's object scope, as the variable was declared as (Test) object property. Hope you get it. And guys correct me if I am wrong, thanks.
  17. Edit: Oh okay, WireFrame πŸ˜‰ --- You should share the code of the class, meanwhile, you can try/compare with this : <? namespace ProcessWire; class Test extends Wire { public $foo1; public function foo2() { return $this->pages->get('/')->children; } public function run() { bd($this->foo1, 'foo1'); // null bd($this->foo2(), 'foo2()'); // set of pages bd($this->foo1 == $this->foo2(), 'comp 1'); // false $this->foo1 = $this->foo2(); bd($this->foo1, 'foo1 assigned'); // set of pages bd($this->foo1 == $this->foo2(), 'comp 2'); // true } } $test = new Test(); $test->run();
  18. You deserve it ! Thanks @Pixraeland @elabx πŸ‘Œβœ… @ryan πŸ‘€πŸ‘‘πŸ˜‚
  19. @bernhard I am getting back to you about this. I had the code not working when I tried it before releasing it, and finally the reason is that before this post, I given a try to get the SSR feature working with Svelte and Inertia. Still no luck, it's not really an issue, but we are screwed at this moment if the app require SEO, but again, I am just speaking about >Svelte<. Nevertheless, SSR works if you like Vue or React, or only JS. Another thing, if some people are also interested, I could share a CI/CD WIP setup for ProcessWire, started after the thread made by @wbmnfktr and the comment of @lokomotivan . Actually fully based on gitpod opensource doc site, taken to build this setup, where a contrario, SSR feature is working for Svelte.
  20. Yes, I used the "hidden field" feature of the forum to avoid a wall of text here in the thread. As you saw later, you can add more fields by following my comments, just a small note about the last portion of code (the input html markup), she is called in "Heredoc" and you can write inside it HTML code as you are used to and call basic PHP variable from there. If you encounter some issue, just think about the PHP version you are using and check the doc, as there is some subtilities since php 7.3; That's it, have fun πŸ‘ When you say you prefer raw code over module, I think you are confusing a bit things. Modules are "raw code", for example, I think like other devs, I always end up writing my code in a module, then call a single method from the module to render the "module's context", which let focusing on the code of the template and not the logic behind, without speaking maintainability and dozens of other reasons. Be ready to receive more "RTFM πŸ“™" answer in the future πŸ˜‚
  21. @wishbone I fully understand you as non coder as we all try to build things for non-coders, but you also already know that non-coders have also to do a minimum; It wasn't my intention to feel rude (please grab this beer 🍻 πŸ˜‰ ) , I was trying to find again a way to say that reading the doc is what could help here. I mean the FormBuilder one, or the tutorial I linked on my previous post. Anyway, back to to your issue. I read the old code you linked, and there is the full code. It works, and if you follow (read again πŸ˜‰) the whole thread lol, you will find the solution for the honeypot technique (page #2 I think posted by @kongondo). About security concerns, there is no breach in the code and can be used as is. But again, without reading the doc, you will eventually get security issues only when you will add more input to the form. I mean here, the $sanitizing technique which give you "control" on the submitted user data. Again, sorry to insist, the FormBuilder module is what you need as non-coder, as I think it doesn't require code to be written, or maybe one line to render the form (I can't confirm, I have to read the doc lol πŸ˜‰ ) and give you all the security you will need to stay safe. Code: Try something with the form, and do not hesitate to ask further help here πŸ‘ Please, believe me, I am speaking by experience, we, coders, are lazy as f***, you can't imagine how πŸ˜‚ Edit: Sorry, I didn't paid attention to your third message, you could head to the Job forum to get more attention.
  22. You also should look at what are saying logs => mysql.err log, errors/exceptions.log (pw), webserver errors log. You should be able to find the reason somewhere for sure. I bet that you cannot add or modify an user due a db issue related to the error you already shown (DATETIME), quite confirmed by looking at the screenshot. If you want me to take a look at your setup, just send me an ssh access by private message, or upload a db backup that I can test.
  23. Did you tried purgecss-webpack-plugin ? Steps to try: yarn add purgecss-webpack-plugin add the plugin to the webpack config const PurgecssPlugin = require('purgecss-webpack-plugin'); [...] .webpackConfig({ plugins: [ new PurgecssPlugin({ paths: glob.sync([ path.join(__dirname, './path/to/**/*.php'), path.join(__dirname, './path/to/**/*.js') ]), whitelistPatterns: [/^animation|cke|v-|active/] }), ] })
  24. Did you upgraded the database server recently ? This could explain your DATETIME issue make a backup of everything (files and database), upgrade ProcessWire to the latest version and try again. ⚠️ πŸ‘‰ Do not forget to replace the .htaccess which require an update as you are running a Processwire version < 3.0.135
  25. Yes I will do it for the weekend. About ProcessWireMix, it's a custom Vite plugin to handle the build and generate the new "loader", which is then used to make the app view. I put a sample code of the the generated loader, but you will understand better with the example πŸ’― <?php // automatically generated at 2022-05-26T17:33:52.671Z by: yarn dev namespace ProcessWire; class ProcessWireMixAssets { const version = '2022-05-26T17:33:52.671Z'; const files = [ "additional_assets" => "assets/dark-theme.css", ]; } function mix($file) { return (isset(ProcessWireMixAssets::files[$file]) ? ProcessWireMixAssets::files[$file] : $file); } function mixVersion() { return ProcessWireMixAssets::version; } <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <link rel="icon" href="<?= $favicon ?>" /> <title><?= $page->title ?></title> <?php if ($vite->isEnabled()) : ?> <script type="module" src="<?= $webappUrl ?>@vite/client"></script> <?php else : foreach ($vite->getCssAssets('src/js/app.ts') as $path) : echo `<link rel="stylesheet" href="{$path}">`; endforeach; endif; ?> <script src="<?= $vite->getAsset("src/js/app.ts") ?>" type="module"></script> </head> <body> <?php /// Inertia echo $inertia->tag; ?> </body> </html>
Γ—
Γ—
  • Create New...