Jump to content

flydev πŸ‘ŠπŸ»

Members
  • Posts

    1,079
  • Joined

  • Last visited

  • Days Won

    34

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

  1. 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.
  2. 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();
  3. You deserve it ! Thanks @Pixraeland @elabx πŸ‘Œβœ… @ryan πŸ‘€πŸ‘‘πŸ˜‚
  4. @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.
  5. 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 πŸ˜‚
  6. @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.
  7. 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.
  8. 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/] }), ] })
  9. 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
  10. 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>
  11. Just to add my two cents to this thread. Generally in Webpack (should be avoided), or now Vite, you wil want to write your own config for the HMR (Hot Module Replacement). Eg, add 127.0.0.1 to $config->httpHosts and then to configure Vite HMR: plugins: [svelte(), ProcessWireMix()], server: { hmr: { protocol: "ws", // wss, http, https host: "127.0.0.1", }, },
  12. Yes just saw the screenshots. Did you upgraded the MySql engine or ProcessWire ? Can you give us the version of mySql and PW please ?
  13. Here again πŸ’‘ I canceled a sponsor and I would like to send theses dollars to @adrian TracyDebugger project. I am again asking for Github Sponsoring Program for two reasons. The first is already said in the quoted message, and the second - take it more as an argument - I could make my boss to click and subscribe for a more important monthly donation than my monthly $15 per project. @adrian @ryan @Robin S
  14. An idea just in case. If you are using a password manager, disable it and try again to save infos.
  15. By definition, a form isn't "simple" as it's not composed by a simple input that we could copy paste 13 times. A simple form is simple when you have someone have already done all the hard work. Technically speaking, even if the form has 1 field, or 13, you still need to follow some simple rules to handle the form or your future website will get hacked; And not because of the ProcessWire fault. All that to finally say, that the solution shown above are effective, and just require you to read the documentation to follow the implemenation that the author had in mind. Because they are smart and talented, they tackled the same problem you encounter and made their modules simple to use. You can also find some guides in the tutorials section of this forum, but I suggest you to buy without brainstorming the pro module made by Ryan if you are looking for a click / copy / paste solution. About the 12 years old code (which should works without hassle lol thats crazzy every time πŸ˜‚) you will find a lot of other working samples code to copy pasta, I still suggest you to read and understand what you are doing πŸ™‚ πŸ‘‡
  16. Did you try without SnipWire ? Without it, I confirm that the four strings are translatable (on pw-3.0.193).
  17. This is because Duplicator, as ProcessWire module, rely on ProcessWire code and thus, the PHP interpreter. Then after saying that, you will remember that in PHP you have basically four (4) errors - notice, warning, parse and fatal error, and you will also remember that a notice give you a hint generally for an undefined variable but do not stop the code, the second tell you that you will end up scratching your head in the future but again do not stop the code. The third tell you that PHP can't parse the code and logically stop the code, as well as the last - the same as you got in - clearly say that the error is fatal and stop the code. At this point, your whole app is broken. If we were using an external tool to make the package/backup, we would not encounter any error. This is the main answer of your question. Hope it help πŸ’‰πŸ˜…
  18. Mmh from what I read, the issue doesn't appear to come from Duplicator but from an issue in /site/templates/_main.php line 79 on the call of displayAds which doesn't exist in Duplicator.
  19. @kalimati could you please give me more information by checking : generated log if it exist located in `site/assets/backups` ProcessWire error log PHP(-fpm) error log then reported back here please. Thanks. Edit: Are you aware of an eventual hosting provider upgrade ? Did the website and/or database as grow since last backup ?
  20. Thanks @Claus, i will push an update to take into account this specific case.
  21. If you create this file on the root directory and navigate to https://mysite.xyz/test_disk.php it should work. ps: Please re-read my edited post above.
  22. @Claus this issue is quite strange as it's a core PHP function. Could you test to create a file test_disk.php containing the following code <?php echo phpversion() . " - " . disk_total_space(__DIR__); ?> and navigate to this php page to check result ? If you still have an issue, it could be that your host disabled this function on php.ini disabled_functions directive. On PHP-8 : Which hosting provider are you using ?
  23. Just to be sure, it's correct to say that if I paste the class you wrote on the other thread and write down the routes, without installing this module it result on the same things ?
  24. I bet that the first version of LR was removed because the module is not maintained in favor of the new version. As well, the pro module make things easy to implement and will let you sleep tight, as most hassles (security.. blabla..) got handled by ryan and contributors. If you want to try it out before pulling out the wallet, you can find the free version on the author's github πŸ™‚ https://github.com/ryancramerdesign/LoginRegister - (I have myself the first version in the wild since years without issue / registration disabled) and you will find some threads around the forum to customize it.
Γ—
Γ—
  • Create New...