Jump to content

adrian

PW-Moderators
  • Posts

    10,902
  • Joined

  • Last visited

  • Days Won

    349

Everything posted by adrian

  1. Hi @Ivan Gretsky - thanks for the file. Unfortunately I can't reproduce yet. I thought perhaps you might have been bootstrapping PW into the action or something like that. Seeing Tracy loaded twice like that is definitely weird. Do you only see that with this action, or any Admin Action? Does it show up when loading the action, or only after running it?
  2. @Macrura - just came across an issue. I am importing content which includes images with cache busting parameters, eg: <img src="https://oldsite.com/image.jpg?1631735176" /> We need to remove that ?1631735176 for things to work. A simple solution is: $html = $page->$ta_field; $html = preg_replace('/(.*)(.jpe?g|.gif|.png)(\?[\d]+)(.*)/', '$1$2$4', $html); Thanks!
  3. It looks like has_parent now supports multiple pages and I think it has served all my needs around this. What can't it do in your use case?
  4. Thanks @monollonom - the new version looks good to me.
  5. Thanks for sorting out the conflicts. Actually thinking about the ML stuff - maybe my proposed solution isn't the best - sites may still be set up with /en/ /es/ etc as a way of having different language URLs for each page without needing to have LanguageSupportPageNames installed. Maybe you could just add an option to enable or disable the select dropdown instead?
  6. This should take care of the language change I am suggesting: if($this->wire('modules')->isInstalled('LanguageSupportPageNames')) { $out .= $this->renderSelectOptions($options); }
  7. Something else to be aware of - getting errors when using this with Ryan's TOTP module. https://github.com/ryancramerdesign/TfaTotp/issues/3
  8. Thanks @monollonom for the new version. One thing I'd like to see is removal of the language dropdown unless "Languages Support - Page Names" is installed. In my case I am using ML, but I don't have language specific URLs, so that dropdown is just confusing. What do you think? Thanks.
  9. Template file contains: $quantity = 'testing'; $data = include_once '/Users/ajones/Sites/ecoreportcard/test.php'; $this->session->set($quantity . '_data', $data); and test.php contains: return array( ///////Units Of Temperature/////// "dimension" => 'dfg', 'base' => 'Kelvin', 'units' => array( "Kelvin" => array("shortLabel" => "K", "conversion" => 1, "plural" => "Kelvin"), //Kelvin - base unit for temperature "Celsius" => array("shortLabel" => "degC", "conversion" => function ($val, $tofrom) { return $tofrom ? $val - 273.15 : $val + 273.15; }, "plural" => "Celsius"), "Fahrenheit" => array("shortLabel" => "degF", "conversion" => function ($val, $tofrom) { return $tofrom ? ($val * 9 / 5 - 459.67) : (($val + 459.67) * 5 / 9); }, "plural" => "Fahrenheit"), ) ); and the result when viewing a page with that template is: Fatal error: Uncaught Exception: Serialization of 'Closure' is not allowed in [no active file]:0 Stack trace: #0 {main} thrown in [no active file] on line 0 I think it really is a simple matter of what the error says. You aren't allowed to serialize closures (and there are two of them in test.php) and saving to $_SESSION serializes the data. There are lots of topics discussing it: https://www.google.com/search?q=php+session+"Serialization+of+'Closure'+is+not+allowed"
  10. @ryan - I think the biggest issue I am seeing is the actual autosave - that's what is causing the 500 error when making the AJAX call. If I the type in buildAjaxRequest() to GET, then I don't get the error any more. It's still not autosaving, but that's not surprising given that ProcessPageEdit is expect GET, but maybe it gives you a clue as to why I might be getting the error. This is what debug is returning: [ "submit_autosave=1", "id=7689", "body=%3Cp%3Ehjhdh+dhjdk+dhjdkg+dfghdf%26nbsp%3B%3C%2Fp%3E%0D%0A", "TOKEN643048379X1637275316=pObPhEnWs6iGOEdu.4kZzL2ATScfNNl0" ] { "type": "POST", "url": "./?id=7689&modified=1637275019&fields=body", "data": "submit_autosave=1&id=7689&body=%3Cp%3Ehjhdh+dhjdk+dhjdkg+dfghdf%26nbsp%3B%3C%2Fp%3E%0D%0A&TOKEN643048379X1637275316=pObPhEnWs6iGOEdu.4kZzL2ATScfNNl0", "dataType": "json" } Autosave error: ajax error: error (body)
  11. It's due to setting that $data to a session. PHP serializes data saved in sessions, so that's the reason for the error. Here are a couple of suggestions: https://stackoverflow.com/questions/39885355/php-serialization-of-a-closure-is-not-allowed This isn't an issue with the Console panel - I get exactly the same error in a template file.
  12. So that is the entire contents of the file at $path? I just tested like this: where test.php contains: return array( ///////Units Of Temperature/////// "dimension" => 'dfg', 'base' => 'Kelvin', 'units' => array( "Kelvin" => array("shortLabel" => "K", "conversion" => 1, "plural" => "Kelvin"), //Kelvin - base unit for temperature "Celsius" => array("shortLabel" => "degC", "conversion" => function ($val, $tofrom) { return $tofrom ? $val - 273.15 : $val + 273.15; }, "plural" => "Celsius"), "Fahrenheit" => array("shortLabel" => "degF", "conversion" => function ($val, $tofrom) { return $tofrom ? ($val * 9 / 5 - 459.67) : (($val + 459.67) * 5 / 9); }, "plural" => "Fahrenheit"), ) ); All I did was change the value of dimension because I don't have that class set up. What am I missing?
  13. Hi @MarkE - could you show how the anonymous function in the included file is set up. Is it like: function() { echo 'test'; }; or echo function() { return 'test'; };
  14. Nice catch @bernhard - should be fixed in the latest version. FYI in case you don't already know - if you are on the module settings page, the RequestInfo panel will show all the module settings. Also, you can just do: d($module); when on a module settings page because $module is set to the current module, same as $field and $template when on the settings for any field or template.
  15. Can you narrow it down to the one problematic module?
  16. Hi @gebeer - thanks for taking the time to debug. I actually only ever see that if I have an emoji character in the console. Regular characters don't cause that for me, but maybe that is environment based. I've added Courier New for you, but I would have though that the "monospace" option at the end would have taken care of things in any environment. I have also updated ACE to the latest version. Let me know if you have any more troubles with it.
  17. Yes - probably a strange thing to do, but the popup window was behind my main window so I didn't notice it. It doesn't update at all - that error happens as soon as I stop typing in on of the fields - so as soon as it tries to trigger an update in the preview window. My server is a VPS box so it shouldn't be any host specific limitations - or at least not any that I can't change. I have played around a little with some of the timeout settings, but no luck so far. No php errors that I can find either. I'll try to take a deeper look later.
  18. Try 1 or 2 GB, but do it in AdminActions.module so it's not affecting your site in general. In reality I think that the backup method from the PW core (that AA uses) needs to be converted to use system tools like mysqldump so it is performant and won't hit these memory limits. I believe I have mentioned this to Ryan somewhere. ProcessDuplicator has the option for this, but I'd rather see it implemented in the PW core.
  19. Interesting you are seeing that so often - it's quite rare for me. I just tested a FB hook but the output looks OK to me. Could you perhaps share something that triggers that stacktrace as a string?
  20. What you're coming across is actually this: https://github.com/processwire/processwire-issues/issues/829 I've been trying to fix it for a while now: https://github.com/processwire/processwire-issues/issues/829 https://github.com/adrianbj/TracyDebugger/issues/35 https://github.com/adrianbj/TracyDebugger/issues/36 https://github.com/adrianbj/TracyDebugger/issues/58 But unfortunately it still doesn't work properly in some scenarios. Could you describe your situation and maybe we can get Ryan involved again to see if he has any ideas or changes he could make to the PW core to prevent this.
  21. @ryan - Ok, I tracked that error down. Uninstalling the module is what triggered that. It turns out that during the uninstall, if I dump $change from inside this foreach: foreach($changes as $key => $change) { I get: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'page_autosave_changes' doesn't exist But back to the more important issue of why the module doesn't actually work for me. Firstly, the module does work on my local dev environment, but on a live servers, it doesn't. I still keep getting: "ajax error: error" If I inspect the Network tab, I see a 500 error for: /page/edit/?id=8074&modified=1636913850&fields=body but there don't seem to be any PHP errors, so I went looking in the apache logs and I am seeing these: [Sun Nov 14 09:54:27.525633 2021] [proxy_fcgi:error] [pid 24560:tid 139854520305408] (70007)The timeout specified has expired: [client 154.5.162.190:51384] AH01075: Error dispatching request to : (polling), referer: /?live_preview=1 [Sun Nov 14 09:54:34.477785 2021] [proxy_fcgi:error] [pid 24560:tid 139854579054336] [client 154.5.162.190:51384] malformed header from script 'index.php': Bad header: {"error":false,"message":"Ajax, referer: /page/edit/?id=8074 [Sun Nov 14 09:54:34.477904 2021] [proxy_fcgi:error] [pid 24560:tid 139854579054336] [client 154.5.162.190:51384] AH01070: Error parsing script headers, referer: /page/edit/?id=8074 [Sun Nov 14 09:54:34.477913 2021] [proxy_fcgi:error] [pid 24560:tid 139854579054336] (22)Invalid argument: [client 154.5.162.190:51384] AH01075: Error dispatching request to : , referer: /page/edit/?id=8074 The Network tab shows Response Headers: content-length: 0 I did a a little investigating to see if there are any known issues with SSE and these errors, but nothing useful so far.
  22. @hellomoto - not really sure where to start to be honest. 1) Is it specific to one site, or all your sites running 3.0.184? 2) Was it working on the same site before you upgraded to that PW core version? If so, what version was the site running before?
  23. I like it :) - that's what I've done in the latest version: Probably not - sorry about that :)
  24. All of Tracy's config settings are available to be modified in the config.php file. Just right click on a setting's input field and "Inspect". Remove the "Inputfield_" prefix from the id and use that. Yeah, probably a good idea. It's kinda ugly, but what about: The bar would be colored like this whenever that forceIsLocal option is set to true. Alternately, we could go with a border, eg:
×
×
  • Create New...