Jump to content

prestoav

Members
  • Posts

    300
  • Joined

  • Last visited

Everything posted by prestoav

  1. PW: 3.0.255 PHP: 8.3.3 Sadly I now have the same issue and I can't find a way around it. Duplicate sites, create a new page on one then try to export the page to the duplicate site and get this error: Error: Call to a member function getLanguageValue() on null in wire/modules/LanguageSupport/FieldtypeTextareaLanguage.module:126 #0 [internal function]: FieldtypeTextareaLanguage->___importValue() #1 wire/core/Wire.php (425): call_user_func_array() #2 wire/core/WireHooks.php (1018): Wire->_callMethod() #3 wire/core/Wire.php (484): WireHooks->runHooks() #4 wire/core/PagesExportImport.php (998): Wire->__call() #5 wire/core/PagesExportImport.php (685): PagesExportImport->importFieldValue() #6 wire/core/PagesExportImport.php (535): PagesExportImport->arrayToPage() #7 wire/modules/Fieldtype/FieldtypeRepeater/FieldtypeRepeaterPorter.php (255): PagesExportImport->arrayToPages() #8 wire/modules/Fieldtype/FieldtypeRepeater/FieldtypeRepeater.module (1006): FieldtypeRepeaterPorter->importValue() #9 [internal function]: FieldtypeRepeater->___importValue() #10 wire/core/Wire.php (425): call_user_func_array() #11 wire/core/WireHooks.php (1018): Wire->_callMethod() #12 wire/core/Wire.php (484): WireHooks->runHooks() #13 wire/core/PagesExportImport.php (998): Wire->__call() #14 wire/core/PagesExportImport.php (685): PagesExportImport->importFieldValue() #15 wire/modules/Process/ProcessPagesExportImport/ProcessPagesExportImport.module (619): PagesExportImport->arrayToPage() #16 wire/modules/Process/ProcessPagesExportImport/ProcessPagesExportImport.module (320): ProcessPagesExportImport->processImportItemToPage() #17 wire/modules/Process/ProcessPagesExportImport/ProcessPagesExportImport.module (242): ProcessPagesExportImport->processImportSubmit() #18 wire/modules/Process/ProcessPagesExportImport/ProcessPagesExportImport.module (76): ProcessPagesExportImport->processImport() #19 wire/core/Wire.php (413): ProcessPagesExportImport->___execute() #20 wire/core/WireHooks.php (1018): Wire->_callMethod() #21 wire/core/Wire.php (484): WireHooks->runHooks() #22 wire/core/ProcessController.php (362): Wire->__call() #23 wire/core/Wire.php (413): ProcessController->___execute() #24 wire/core/WireHooks.php (1018): Wire->_callMethod() #25 wire/core/Wire.php (484): WireHooks->runHooks() #26 wire/core/admin.php (174): Wire->__call() #27 wire/modules/AdminTheme/AdminThemeUikit/controller.php (15): require('/home/u99035861...') #28 site/templates/admin.php (15): require('/home/u99035861...') #29 wire/core/TemplateFile.php (328): require('/home/u99035861...') #30 wire/core/Wire.php (413): TemplateFile->___render() #31 wire/core/WireHooks.php (1018): Wire->_callMethod() #32 wire/core/Wire.php (484): WireHooks->runHooks() #33 wire/modules/PageRender.module (547): Wire->__call() #34 wire/core/Page.php (3152): PageRender->render() #35 wire/core/Wire.php (416): Page->___renderPage() #36 wire/core/WireHooks.php (1018): Wire->_callMethod() #37 wire/core/Wire.php (484): WireHooks->runHooks() #38 wire/core/Page.php (3097): Wire->__call() #39 wire/core/Wire.php (413): Page->___render() #40 wire/core/WireHooks.php (1018): Wire->_callMethod() #41 wire/core/Wire.php (484): WireHooks->runHooks() #42 wire/modules/Process/ProcessPageView.module (193): Wire->__call() #43 wire/modules/Process/ProcessPageView.module (114): ProcessPageView->renderPage() #44 wire/core/Wire.php (416): ProcessPageView->___execute() #45 wire/core/WireHooks.php (1018): Wire->_callMethod() #46 wire/core/Wire.php (484): WireHooks->runHooks() #47 index.php (56): Wire->__call() #48 {main}
  2. Hi @poljpocket and thanks for your response. I did make the backup with the same module as you suggest. The is JSON content at the end of the file as follows: # --- /WireDatabaseBackup {"numTables":140,"numCreateTables":140,"numInserts":19412,"numSeconds":1}
  3. PW 3.0.255 ProcessDatabaseBackups 0.0.6 PHP 8.3.30 On restore I am seeing this error: Passing null to parameter #1 ($num) of type float is deprecated in ***/site/modules/ProcessDatabaseBackups/ProcessDatabaseBackups.module on line 243 The line in question seems to be this one: $this->tdSort($file['numInserts'], number_format($file['numInserts'])), Within: foreach($backupFiles as $id => $file) { $numFiles++; $numTables = $file['numTables']; if($numTables && !count($file['tables'])) $numTables .= " " . $this->_('(all)'); $basename = $file['basename']; $time = $file['time'] ? $file['time'] : $file['mtime']; if($file['description']) $basename .= '*'; $actions = array(); foreach($this->getFileActions($file) as $action) { $actions[] = $this->aTooltip($action['href'], wireIconMarkup($action['icon'], 'fw'), $action['label']); } $checkbox->attr('id', "delete_" . $sanitizer->fieldName($id)); $checkbox->attr('value', $id); $table->row(array( $this->nowrap($basename) => "./info/?id=$id", $this->tdSort(strtotime($time), wireRelativeTimeStr($time, true)), $this->nowrap($numTables), $this->tdSort($file['numInserts'], number_format($file['numInserts'])), $this->tdSort($file['size'], wireBytesStr($file['size'])), $this->nowrap(implode(' ', $actions)), $checkbox->render(), )); } If anyone has an ideas for a fix please do let me know as I use this module a lot!
  4. Thanks for an awesome module. This one is going to be super useful! I've deployed this today to generate descriptions for Audio Visual brands using OpenAI and got it working without major issues. I noticed a couple of things worth looking at: 1) I couldn't get the Test Chat to work with GPT-5 Nano - a response was received but the content was empty. Switching to GPT 4.1 worked fine. 2) If using OpenAI as a single provider I had to use the 'provider' option or I got an error in the response saying 'no key for Anthropic' or similar. It would be useful here if, be default, it would use whichever provider was found with an active key perhaps? That way the 'provider' option wouldn't be needed unless for a specific call to a specific provider. 3) It would be useful if the number of total used tokens and / or tokens still available information from the provider was presented in the module. I'm not sure if that information is even possible from their API though? Thanks again. I look forward to using this module more in future!
  5. Absolutely. I always make that point as I believe it's confusing. In all but one of of my multi-lingual sites I won that discussion a we use language names (English, Français, Deutsch etc). However, this particular client insisted...
  6. Hi @zilli sadly not. In the end I had to take a different approach... I have a 'library' section of countries (page per country) that contains the country name, two digit country code etc. I built this some years ago and it's in every site I build so I can generate a quick list anywhere on a site and any admin can publish / un-publish countries they do or don't want in their lists. I ended up moving the flag image field to the country page template and added the images there. I then added a page selector field to the language template that chooses the country form which to pull the flag. Not ideal but it worked. Hope that helps.
  7. Hi @David Karich this is awesome news. Thank you for all your hard work on this!
  8. I haven't tried the template caching quite yet but it's on my 'discovery' to-do list for sure!
  9. Speaking as a user, this module is incredibly helpful and I'd love to see it back in the main module directory and continuing to me maintained. Thanks to you both.
  10. Hi @matjazp Thanks for the information. I've be playing with your fork version this morning it's worked well. Any chance you'll add this to the module directory?
  11. Hi @matjazp, thank you for the information. Could you share a link to your fork of this module? Thanks!
  12. For anyone trying to use this module in PHP 8, after changing the 2x lines mentioned previously in the main module file I was getting the following error at line 314 of /lib/JSMin-2.1.7.php : ord(): Passing null to parameter #1 ($character) of type string is deprecated The line in the file is: if (ord($c) >= self::ORD_SPACE || $c === "\n" || $c === null) { return $c; } Changing it to his solves the issue: if ($c === null || ord($c) >= self::ORD_SPACE || $c === "\n") {return $c;} @David Karich This is a super module and including the three line changes outlined in this thread would be a really nice thing if possible!
  13. Triggering Custom JS function Hi folks, I'm using Privacywire on a number of sites and it;s working well, thank you! With Microsoft Clarity now moving to requiring a consent signal on cookie acceptance I had hoped to run a signal function for this with the 'Trigger a custom JS function' setting in Privacywire's config (right at the bottom). However, having declared a test function (to just console.log something) higher up in the page script files, and adding the function name into the Custom JS function field in Privacywire, I can't get the function to run when cookies are accepted. I have tried both the function name (e.g. 'myFunction') and with brackets (e.g. 'myFunction()') but neither seems to work. Anyone tried this and got it to work? Thanks for any help!
  14. Haha! Actually, I see now that the fix they suggested only works for front end pages (and that will help form submissions I guess)? However, it does not apply to admin editing and the error is still there when you first login. Ah well...
  15. I was about to post about this subject as I have the same issue when I found this chain... I found the solution posted by @psy resulted in a 500 server error for me. After a support chat with Hostinger's chat bot (presumably AI...) it seems that it is not possible to set the Database time on some Cloud / Shared hosting services - hence the 500 error. They recommend they following hook be added to ready.php to set it at page load: // Set correct Database time $wire->addHookAfter('ProcessPageView::execute', function() { $this->wire('database')->exec("SET time_zone = 'Europe/London'"); }); Now this does work. However, I raised concern that this seems to set the DB time every time a page loads and that this might unnecessarily increase processing overhead. However, they state it is not possible to set it a session level so has to be done at page load level. It seems to be running OK on an (admittedly) low traffic site. Anyone have any further thoughts on the impact of this though?
  16. Hi all, I've created a regular, single image field called 'Flag' and added it to the 'language' template ready to add a flag image for each language in order to display them as part of the language switch n the front end. Issue is - when I try to upload a regular .jpg image to the field the image seems to upload OK but then, when I save the page, the image disappears. There are no images in the /site/assets/files folder for the language page and no obvious errors in the JS console or Network console. I also noted that the image field has the 'Find Files To Translate' button added (see below)? Any ideas as to what the problem is are gratefully received!
  17. Hi folks, I've been approached but a potential client that needs a PW developer to take over and existing site. My schedule is full at the moment (very thankful for that) but I said I would try here to see if anyone was available to take it on. I'm not taking anything, just passing on details as a favour. I've had a quick look through the site so far just so I can describe it but did not develop the site myself. The main site has been built on PW and the core has been upgraded to the latest version (3.0.246). The front end uses alpine.js a fair bit and there is a Shopify integration for commerce. The eCommerce has not been launched yet. Immediate jobs appear to be: Several module upgrades need to be run, ready for... PHP version on hosting needs to be switched from 7.x to 8.x Shopify integration needs to be tested for launch soon then upgrade to meet Shopify changes later in Q2 If interested, perhaps you could either DM me on here or leave your own website URL in the chain here and I'll forward everything. Cheers for now.
      • 3
      • Like
  18. Hi @bernhard, This is super useful. Thank you and have a great weekend! Geoff.
  19. Hi @bernhard and thanks for taking time to answer my question. I must confess, I had not considered the 'old pages' problem but what you say does makes sense. I'm not keep on the 'double negative' approach to the field instruction as, while it solves the technical issue, it doesn't feel like good UX for the admins, at least in my application. However, the idea of a hook to set that field on page creation does seem like a way forward. Thanks again.
  20. Hi folks, Is there any way to setup a checkbox field so that is checked by default? I can't see that in the field admin and where. Thanks!
  21. OK, solved it. For some reason the admin template was setup correctly. Templates > admin > access should be set like this: Mine was set to option C which meant, as a 'guest' before logging in, I had no permission to see the admin login page and was redirected to the main root of the site. Phew!
  22. Actually, scrub that. There was a typo in what I added. Now corrected and we're back to the original result. Logging out redirects to the root page rather than the login screen.
  23. Hi @da² thanks for your thoughts. .htaccess - The .htaccess files is a direct copy of the working one on the development installation (i copied it over earlier today to be sure) so I don't think that's it. 404 in config - there wasn't one in the config file so I added the once you stated above and now on logout I get a redirect to 'mysite.com/admin/login/logout/' which throws a 'this page isn't working' error. That's new so you might be on to something? Hooks - the only hook in the ready.php is the standard one for logging sent emails and that has no redirects in it so I think we can rule that out too :-(
  24. Hi all and seasons greetings! I have a problem that's driving me a bit mad and wondered if anyone in this wonderful community can throw any light on it. I have three copies of the same site, a marketplace where registered users can add listings. The copies are localhost (on MAMP), development, and live (www). All copies are running: PW 3.0.229 PHP 8.08 All copies are also running a duplicate set of /site/ and /wire/ files. The live and development copies are running on the same server. On one copy of the site (annoyingly the live one...) I cannot access the admin login page directly. I have '/admin/' setup as the admin page. Whenever I try the url - 'www.thesite.com/admin/' it diverts to the root page of the site 'www.thesite.com'. As it's a marketplace, I can access the admin by first using the 'public' login screen for members then pasting 'www.thesite.com/admin/' into the URL bar. This redirects to www.thesite.com/admin/page as you'd expect. When I logout again the system diverts to the root page of the site rather than the admin login page. Since I can login on the user facing login page, and the logout function diverts to the root of the website rather than the admin login page, I'm thinking the issue is with the login page / login process. I'm not familiar with how this works but I have compared the /wire/Modules/Process/ProcessLogin/ folders and they look to be the same (and file sizes report the same). I should also say that all other admin functions work fine once logged in. The only difference between the three sites I can think of is the database as the live one has all the latest listings in etc. Does anyone have ideas as to what might be causing this, or could explain how the login process works? As always, any help is really appreciated!
  25. Many thanks @gebeer for this. Some of what is needed could certainly be handled by the page tree. I hadn't tough of that. However, I think I'll also look through the URL hooks idea as that might be the only way to handle some of the more complex issues.
×
×
  • Create New...