ngrmm
Members-
Posts
480 -
Joined
-
Last visited
-
Days Won
3
ngrmm's Achievements
-
It was my fault. You have to uninstall and reinstall the module as you have hinted on github. Then the new fields are added to your language templates. So I did not not change anything in the code and it works
-
@robert – yes line 118 is private static function convertGlossaryStringToArray(string $glossaryString = ''): array { – I'm afraid i don't know what and where the language-specific translate_glossary field is 🙂 – using DeepL API Free UPDATE: ahhh, I updated from an very old version and didn't know that you have to add fields to the language template. Trying now to find out how to edit a language template. UPDATE: my fault. You have to uninstall and reinstall the module. Then the new fields are added to your language templates. Thanks again!
-
@robert thanks! I updated to 1.3 and still getting the same error. Is this maybe related to my empty DeepL Glossary ID field?
-
ngrmm started following How to refresh page tree after a hook and ProcessTranslatePage
-
@robert I' using PW 3.0.210 – Fluency 2.3 – Translate Page 1.1 Using Save + Translate runs into this: Uncaught TypeError: TranslateGlossary::convertGlossaryStringToArray(): Argument #1 ($glossaryString) must be of type string, null given, called in site/modules/ProcessTranslatePage/TranslateGlossary.php on line 34 and defined in site/modules/ProcessTranslatePage/TranslateGlossary.php:118 #0 site/modules/ProcessTranslatePage/TranslateGlossary.php (34): TranslateGlossary::convertGlossaryStringToArray() #1 site/modules/ProcessTranslatePage/TranslateGlossary.php (18): TranslateGlossary->createGlossary() #2 site/modules/ProcessTranslatePage/ProcessTranslatePage.module.php(169): TranslateGlossary->__construct() #3 site/modules/ProcessTranslatePage/ProcessTranslatePage.module.php(207): ProcessTranslatePage->initApi() #4 wire/core/WireHooks.php (1060): ProcessTranslatePage->hookTranslatePageSave() #5 wire/core/Wire.php (484): WireHooks->runHooks() #6 wire/core/PagesEditor.php (702): Wire->__call() #7 wire/core/PagesEditor.php (478): PagesEditor->savePageFinish() #8 wire/core/Pages.php (840): PagesEditor->save() #9 wire/core/Wire.php (419): Pages->___save() #10 wire/core/WireHooks.php (952): Wire->_callMethod() #11 wire/core/Wire.php (484): WireHooks->runHooks() #12 wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module (2128): Wire->__call() #13 wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module (563): ProcessPageEdit->processSave() #14 wire/core/Wire.php (413): ProcessPageEdit->___execute() #15 wire/core/WireHooks.php (952): Wire->_callMethod() #16 wire/core/Wire.php (484): WireHooks->runHooks() #17 wire/core/ProcessController.php (350): Wire->__call() #18 wire/core/Wire.php (413): ProcessController->___execute() #19 wire/core/WireHooks.php (952): Wire->_callMethod() #20 wire/core/Wire.php (484): WireHooks->runHooks() #21 wire/core/admin.php (160): Wire->__call() #22 wire/modules/AdminTheme/AdminThemeUikit/controller.php (15): require('/usr/www/users/...') #23 site/templates/admin.php (18): require('/usr/www/users/...') #24 wire/core/TemplateFile.php (328): require('/usr/www/users/...') #25 wire/core/Wire.php (413): TemplateFile->___render() #26 wire/core/WireHooks.php (952): Wire->_callMethod() #27 wire/core/Wire.php (484): WireHooks->runHooks() #28 wire/modules/PageRender.module (575): Wire->__call() #29 wire/core/Wire.php (416): PageRender->___renderPage() #30 wire/core/WireHooks.php (952): Wire->_callMethod() #31 wire/core/Wire.php (484): WireHooks->runHooks() #32 wire/core/WireHooks.php (1060): Wire->__call() #33 wire/core/Wire.php (484): WireHooks->runHooks() #34 wire/modules/Process/ProcessPageView.module (184): Wire->__call() #35 wire/modules/Process/ProcessPageView.module (114): ProcessPageView->renderPage() #36 wire/core/Wire.php (416): ProcessPageView->___execute() #37 wire/core/WireHooks.php (952): Wire->_callMethod() #38 wire/core/Wire.php (484): WireHooks->runHooks() #39 index.php (55): Wire->__call() #40 {main} thrown (Zeile 118 in site/modules/ProcessTranslatePage/TranslateGlossary.php)
-
ProcessPagesExportImport on multilanguage website
ngrmm replied to spoetnik's topic in General Support
@spoetnik export/import works with multilanguage pages The new website has to have the same languages as the origin website. And you need to have the right paths for parents. -
UPDATE: I think I found a solution. You have to remove the InputfieldStateChanged class from the field wrapper after your AJAX changes. function resetFieldState(fieldId) { const wrap = document.querySelector(`#wrap_${fieldId}`); if (wrap?.classList.contains('InputfieldStateChanged')) { wrap.classList.remove('InputfieldStateChanged'); } } // then use resetFieldState('Inputfield_your_fieldname') after your ajax code
-
I’m working on a custom runtime markup field in ProcessWire’s admin. This field loads DOM elements asynchronously after the page loads (via JavaScript), updating part of the form visually. The problem: When I try to leave the page without actually changing any form inputs, the "There are unsaved changes, are you sure you want to leave?" prompt still appears. I suspect ProcessWire's admin JavaScript is detecting these DOM changes, but I’m unable to find which JS object or event is responsible. Can anyone share how ProcessWire’s admin detects changes or how to override/reset that state? Or pointers on what JS objects or events to manipulate? Thanks a lot in advance!x
-
I need a simple htpasswd protection for my website
ngrmm replied to tires's topic in General Support
@tires I can't help you with the htaccess But you could just use ProtectedMode https://processwire.com/modules/protected-mode/ -
@kaz beware // hreflang="english" is not valid // it should be hreflang="en" <link rel="alternate" hreflang="en" href="https://domain.local:8890/en/services/" />
-
this is how I did it // Output a default alternate link for search engines that don't support hreflang echo "<link rel='alternate' hreflang='x-default' href='$page->httpUrl' />"; // Loop through all available languages foreach($languages as $language) { if(!$page->viewable($language)) continue; $url = $page->localHttpUrl($language); $hreflang = $language->name; // Replace "default" with "de" (assumes "de" is the default language) $hreflang = ($hreflang == 'default') ? "de" : $hreflang; // Output the alternate link for the current language echo "<link rel='alternate' hreflang='$hreflang' href='$url' />"; }
-
I meant something else. You're using FormBuilder, which offers four different options (A, B, C, and D) to embed your form into a template or page. For example, if you use option D, you're implementing custom code, and the rendering is not handled by FormBuilder. In that case, the hook would have no effect.
- 4 replies
-
- 1
-
-
- formbuider
- hidden input
-
(and 1 more)
Tagged with:
-
which embed type are you using?
- 4 replies
-
- formbuider
- hidden input
-
(and 1 more)
Tagged with:
-
@bernhard that was it, thanks a lot!
-
Page is moved after being unpublished via a hook. If you do on the page directly (settings tab) you have to click on the save button. This trigger a reload and everything is fine. But if you unpublish a page via the action button in the page tree view, there is no forced reload. Is there a way to force a refresh of the page tree via JS? $wire->addHookBefore('Pages::save', function($event) { $p = $event->arguments(0); if($p->template == 'funding_item') { // Disable output formatting $p->of(false); $newParent = wire('pages')->get(1234); $p->parent = $newParent; $p->save(); } }); UPDATE: I'm forcing it this way right now. But there should be a way to do it via AJAX as PW page tree is working on default. // config.php $config->scripts->add($config->urls->templates . "/scripts/_admin/pagetree_move.js"); // pagetree_move.js document.addEventListener("DOMContentLoaded", function() { const observer = new MutationObserver((mutationsList, observer) => { const unpublishButtons = document.querySelectorAll('.PageListTemplate_template_name a.PageListActionUnpublish'); unpublishButtons.forEach((btn) => { if (!btn.dataset.listenerAttached) { btn.dataset.listenerAttached = "true"; btn.addEventListener('click', function () { console.log('Unpublish clicked'); setTimeout(() => { location.reload(); }, 1000); }); } }); }); observer.observe(document.body, { childList: true, subtree: true, attributes: true }); });