Jump to content

froot

Members
  • Posts

    707
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by froot

  1. oh my, it was just a human error, I mixed up the logged-in accounts 🙈 Maybe I need to retire… or just need a vacation 😃
  2. $user is the native user https://processwire.com/api/ref/user/ Isn't that what this module interacts with? Also, I'm actually using PageClass on the user class, i.e. class UserPage extends User { … } not sure if that's the culprit. I can apparently access the fields on a UserPage object just fine however.
  3. if($user->isLoggedin() && !$input->get('profile') && !$input->get('logout')) { echo '<h2>'.__('Mein Profil').'</h2>'; echo '<p><strong>'.$user->fields[130].': </strong>' . '<span>'.$user->givenname.'</span></p>'; echo '<p><strong>'.$user->fields[131].': </strong>' . '<span>'.$user->lastname.'</span></p>'; echo '<p><strong>'.$user->fields[92].': </strong>' . '<span>'.$user->email.'</span></p>'; echo '<p><strong>'.$user->fields[171].': </strong>' . '<span>'.$user->units_balance.'</span></p>'; } I don't know why none of the values don't return anything (in the span tags). Also, the ->fields[] API is not very elegant either.
  4. https://github.com/dtjngl/DiagnosticLogger # DiagnosticLogger Do you struggle like me with keeping track of updates across multiple website projects? Do you also feel like your clients are unaware of what web development maintenance involves? Do you sometimes feel unappreciated for your hard work? If so, here's a solution for you. It's not perfect, but it's a start. **DiagnosticLogger** is a ProcessWire module designed to handle diagnostic logs and create notifications in the admin GUI. It can also send automated email summaries for warnings and errors found in these logs. ## Features - **Log Handling**: Captures and processes diagnostic logs. - **Admin Notifications**: Displays notifications within the admin GUI for detected issues. - **Email Summaries**: Sends automated emails summarizing warnings and errors. ## Integration The module integrates with **ProcessDiagnostics**, which is required for its functionality. It is designed to work seamlessly with ProcessDiagnostics but is not highly configurable. ## Important!! I wasn't able to accomplish this in the hook from inside the DiagnosticLogger class so you need to add these lines in the ProcessDiagnostics.module file to make this work. public function ___execute() { wire('log')->delete('diagnostics'); // to not be redundant // … foreach ($results as $caption => $section_results) { // … foreach ($section_results as $k => $row) { // … wire('log')->save('diagnostics', '|' . $row['title'] . '|' . $row['value'] . '|' . $row['status'] . '|' . $row['action']); } } } This will log the diagnostics everytime the ProcessDiagnostics runs. I still haven't figured out how to run diagnostics automatically or schedule them. ## Workaround for Background Diagnostics The logging feature acts as a workaround due to difficulties with running diagnostics in the background. The hooked method from ProcessDiagnostics will need to be made hookable for better integration. ## Configuration 1. Access the configuration settings in the ProcessWire admin interface. 2. Adjust the settings according to your needs. ## email LazyCron Scheduling For scheduling tasks using LazyCron, for example: - every2Weeks: Runs tasks every two weeks. - everyDay: Runs tasks every day. - everyWeek: Runs tasks every week. ## Installation 1. Download the module and place it in the `site/modules` directory. 2. Log in to the ProcessWire admin interface. 3. Go to Modules > Refresh. 4. Locate **DiagnosticLogger** and click **Install**. ## Usage Once installed, **DiagnosticLogger** will automatically start processing diagnostic logs. You can view notifications in the admin GUI and receive email summaries based on your configuration. ## Requirements - ProcessWire 3.x or later - ProcessDiagnostics module
  5. As you can see in the screenshots, the PW logo (and maybe other less apparent stuff too) have links to files inside the AdminThemeBoss folder that don't even exist anymore, because I uninstalled it and deleted it. So that must mean, that this is set in the database but when uninstalling the theme, links are not reset? What to do? Can't find anything when searching the database for "boss" or "adminthemeboss".
  6. OK I found a way to disable it, not necessarily the root of the problem though. I had the core module SystemNotifications installed and "Notification status" was turned on. I turned it off now and the issues disappeared. It's a core module, so is that the expected behaviour? Or is it a known bug? I'm reluctant to install it on other installations just to investigate it further…
  7. thanks but that doesn't seem to help either, neither clearing cache nor the hard refresh.
  8. I have this one installation where the messages, warning and error appear on top of the header and also float above the button on the top right in the admin GUI, see screenshots. I thought it had to do with some admin theme that I once installed, namely AdminThemeBoss and somehow I can still see its effects even though I switched back to Uikit theme. I now also uninstalled, deleted that AdminThemeBoss, cleared compiled files, refreshed the site, downgraded PW /wire/ folder, upgraded back, nothing seems to help. How can I get rid of it? It's quite annoying because the floating messages cover the button and I have to wait till they are gone so I can push the button. Or is the issue unrelated after all? Thanks for help!
  9. Hi everybody, hello @netcarver, Is this module maintained? In one of my projects I'm seeing status "Pending" among the Module Version Diagnostics and so no diagnostic is returned. Does that have to do with the particular web server settings or what else could be the reason for that? Thanks for help!
  10. Hi @kongondo ! I'm still having the same issues as half a year ago, namely that I cannot navigate to the next paginated page inside MM. I was hoping that the next major update would fix that. Do you have an estimate when that will be released? Or can you help me fix the acute issues?
  11. have to revisit this. Inline CSS works but what about adding CSS classes? They always get stripped. Other tags (like <footer>) don't work either . I tried: 'allowedContent' => true, // Disables ACF completely 'extraAllowedContent' => 'div[*]{*}; footer[*]{*}; p[*]{*}; img[*]{*}; a[*]{*}; span[*]{*};',
  12. OK here I am answering my own question, courtesies to chatGTP… 'extraAllowedContent' => '*(*){*}', // Allow any element, with any attribute, and any inline style happy days! thoughts?
  13. Not sure if I or someone asked this before… I'm working on a module that implements Module, ConfigurableModule On the config.php page, I define a field like so: 'email_imprint' => array( 'label' => 'Email Imprint', 'type' => 'CKEditor', 'value' => '', 'useLanguages' => true ), This works fine. My question is, how can I make this CKEditor field allow for inline markup? If I want to allow inline css in a CKEditor field I define in the GUI I can configure this in the field's settings, but here… ?
  14. Hello Processwirers, I'm trying to access a field's label in the current user language: $this->template->fields->skills->label // returns either "skills" or "Kenntnisse" depending on the language /en/ or /de/ $this->related_tutor->template->fields->skills->label // always returns "skills" no matter the language The label for the field is set in different languages. related_movie is a related page (aka "page field") and that related page is a user, i.e. uses a system template (– might that be the issue?) Why doesn't this work for related pages?
  15. Hello Processwirers, I'm trying to access a field's label in the current user language: $this->template->fields->skills->label // returns either "skills" or "Kenntnisse" depending on the language /en/ or /de/ $this->related_tutor->template->fields->skills->label // always returns "skills" no matter the language The label for the field is set in different languages. related_movie is a related page (aka "page field") and that related page is a user, i.e. uses a system template (– might that be the issue?) Why doesn't this work for related pages?
  16. how to return an array of the menu items? So far I was not successful. $menu = $modules->get('MarkupMenuBuilder');// $menu is an example echo $menu->getMenuItems('topmenu'); // topmenu is the name of my menu But it only returns Menu|Menu|Menu How can that be?
  17. I'm trying to achieve the following: I already have a selectoptions field with a specific page array. I want to add custom links to that array that I would define as JSON inside another field "menulinks" on this very settings factory page. How can I access the fields value while I'm on the settings page? I understand I would need to save the page first before the value is accessible inside the options field? So how to access the value? It must be stored somewhere… // Assume $fields is your instance of the Fields API in ProcessWire // Fetch the 'menu_allocation' field $menuField = $fields->get('menu_allocation'); // Get the options for the 'menu_allocation' field $menuOptions = $menuField->type->getOptions($menuField); // Create an empty array to store the page arrays for each option $pageArrays = array(); // Loop through each menu option foreach ($menuOptions as $menuOption) { // Convert $menuOption to a string $menuOptionString = (string)$menuOption->title; // Create a selector to find pages with 'menu_allocation' set to the current option $selector = "menu_allocation=$menuOptionString, sort=sort"; // Find pages that match the selector $treePages = $pages->find($selector); // Convert the pages to an array $pageArray = array(); foreach ($treePages as $page) { $pageArray[$page->id] = $page->title; } // Add the page array to the main array $pageArrays[$menuOptionString] = $pageArray; } $inputfields = array( array( 'name' => 'menulinks', 'label' => 'menulinks', 'type' => 'textarea', 'value' => '', 'columnWidth' => 30, ), ); // json_decode the "menulinks" value to an array // merge the resulted array with the pageArrays // Loop through each page array and create 'asmselect' field foreach ($pageArrays as $menuOption => $pageArray) { $inputfields[] = array( 'name' => 'page_select_' . $menuOption, // Unique name based on $menuOption 'label' => 'Select a page for ' . $menuOption, 'type' => 'asmselect', 'description' => 'Select a page from the page tree for ' . $menuOption, 'columnWidth' => 100, 'useLanguages' => false, 'options' => $pageArray, // Use the page array as options for the 'asmselect' ); } return $inputfields;
  18. is there a way to make the options multilingual?
  19. @adrian I get the following error with your fork version: 385: $pageData['og:image'] = $pageData['image'] ? $pageData['image']->httpUrl() : ''; The error only occurs on the "home" page and on direct children to home, not sure if that's important to mention, nor sure if the problem occurs because it cannot find an image to inherit?
  20. I'm facing a similar issue now, this PHP Warning: Undefined array key "EUR" in .../ServiceCurrencyConversion/ServiceCurrencyConversion.module:341 PHP Warning: Trying to access array offset on value of type null in .../ServiceCurrencyConversion/ServiceCurrencyConversion.module:341 and this is what it says in the module settings: ServiceCurrencyConversion: access_restricted - Access restricted until 2024-04-14 (reason: too_many_requests). If there has been a mistake, please contact support@openexchangerates.org. And the site is not even live, I'm still developing locally, so it's just me requesting. I have a free account with Open Exchange Rates. I wonder if I just programmed the request-handling poorly, I assumed the module would make a request to Open Exchange Rates via API and then cache the results somewhere? Or do I need to cache it somehow manually? I don't need real-time exchange rates, maybe just one per day for what ever currency is requested would be more than sufficient.
  21. I did something like this: <div class="grid grid-cols-4 gap-4 border border-green-500"> <div class="col-span-3"> <img src="path/to/image.jpg"/> </div> <div class="col-span-1"> <p>Yada yada yada.</p> </div> </div> But the classes don't get applied. Might that have to do with where in which directories tailwind looks for tw classes? Here's my setup: /** @type {import('tailwindcss').Config} */ module.exports = { content: [ "../*.{html,php,js}", "../../classes/*.{html,php,js}", "./node_modules/tw-elements/dist/js/**/*.js", "../../assets/cache/HannaCode/*.{html,php,js}", "../../assets/*.{html,php,js}", "../../../*.{html,php,js}", "./node_modules/flowbite/**/*.js" ], That said, it does work for the hard-coded tw classes anyway, that's why I thought that might be the issue.
×
×
  • Create New...