Jump to content

ngrmm

Members
  • Posts

    480
  • Joined

  • Last visited

  • Days Won

    3

ngrmm last won the day on March 21 2024

ngrmm had the most liked content!

Contact Methods

  • Website URL
    https://www.engramm.com

Profile Information

  • Gender
    Not Telling
  • Location
    Germany

Recent Profile Visitors

7,649 profile views

ngrmm's Achievements

Sr. Member

Sr. Member (5/6)

203

Reputation

2

Community Answers

  1. 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
  2. @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!
  3. @robert thanks! I updated to 1.3 and still getting the same error. Is this maybe related to my empty DeepL Glossary ID field?
  4. @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)
  5. @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.
  6. 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
  7. 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
  8. @tires I can't help you with the htaccess But you could just use ProtectedMode https://processwire.com/modules/protected-mode/
  9. @kaz beware // hreflang="english" is not valid // it should be hreflang="en" <link rel="alternate" hreflang="en" href="https://domain.local:8890/en/services/" />
  10. 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' />"; }
  11. I'm not sure if this works via the field in the backend, but you could handle it with a hook. https://processwire.com/api/ref/form-builder-processor/email-form/
  12. 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.
  13. which embed type are you using?
  14. @bernhard that was it, thanks a lot!
  15. 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 }); });
×
×
  • Create New...