Jump to content

netcarver

PW-Moderators
  • Content Count

    1,821
  • Joined

  • Last visited

  • Days Won

    35

Everything posted by netcarver

  1. There is a module that does something a bit like this already.
  2. @PWaddict Which log file did you spot that in? Also, you can try the ProcessDiagnostics module as it has a DB helper that can run table repairs. You should always back up the DB first though before any operations like that.
  3. This sounds like an API bug, is it worth reporting this as an issue as well?
  4. @ryan Not sure if small requests count here in this storm of idea goodness. Please could you make ProcessLogger::formatLogText() hookable?
  5. If you think you've found a bug in WireDatabasePDO, please do open an issue for it in the processwire-issues repository.
  6. You'd know if your processes were forking as you'd be doing it yourself, or running software like php-resque that does it for you, so what I described above probably isn't the cause in your case.
  7. @monollonom If you are using ProcessWire's database (ie $this->database, wire('database') or wire()->database depending on context) then yes, it should connect again on the next query. What might be more interesting is trying to find out why the MySQL server is going away. Do you have any processes (like your API stuff) that are forking by any chance? If this is the case, the code in the forked process gets a copy of the parent state - including the pdo driver state - and when the child process uses that state to access MySQL, the DB server can close the connection, leading to "2006 MySQL server has gone away" for both the child and the parent processes. I discovered this running PW-bootstrapped code from forked PHP processes in some of my own installations where I have background workers processing various jobs. I do not know for sure why MySQL closes the connection, but my working hypothesis is that it closes it when it sees it being accessed from a different process ID. The cure, however, is fairly easy in these cases as you just make sure the first thing your forked code/background worker does is close the db connection - forcing the child process to create a new connection on the next database call which it then uses for the remainder of its operation, and leaving the parent process' connection intact and operational as well. Taking this action in my forked code totally cleared up these "2006" errors for me.
  8. @muzzer Nice find, thanks for posting about it. Please could you add an issue to the issues repo for this.
  9. Hi @Adam I upgraded a live site to the new version and, unfortunately, the update causes a 500 internal server error on PW 3.0.148. I suspect you might need to add a PW version check before calling the parent init() function. I've verified that it's the changed line by commenting it out and the module then functions properly again.
  10. @modifiedcontent Not quite your question but in your template, where you are rendering the comments entry form, you can do this instead. This should set up the correct value for the cite field for new entries... <?php echo $page->comments->renderForm([ 'presets' => [ 'cite' => wire()->sanitizer->entities($user->fullname), ], ]); For existing entries, I think you can iterate the comments and then set the cite attribute to the value you want.
  11. Great, thank you @BitPoet Would be good to get the count of deleted keys back from deleteFor() rather than the value of the $force parameter. I've updated my dev fork to return the count of deleted keys.
  12. @BitPoet I've cloned the module and pushed an experimental script for deleteFor() here. It uses a Lua script that's evaluated in the Redis server. My rough testing using 100k namespaced keys shows this to be much faster than iterating over the scan results in PHP and the PHP cpu + network load is also much lower. However, that is at the cost of blocking the Redis server whilst the delete is taking place. I've not massaged this into a pull request yet, as I'd like to get your feedback on it.
  13. Even then, for large cardinalities, the Lua script idea (with or without a hash/set holding the key references) would be blocking on other processes using Redis. So this might not be ideal either. At least with your current implementation it's non-blocking as there are separate calls to redis. However, that needs to be weighed against the network overhead.
  14. Looking forward to the update, @Adam
  15. @BitPoet Fantastic, thank you. I guess you mean the flushing of a namespace regarding the SCAN with DEL/UNLINK operations? Hmm, I wonder if we could keep either a hash or set for all the keys within a namespace, then flushing the namespace could become something like a lua EVAL that iterates the hash/set doing the deletes and then empties the hash/set as one atomic operation without a load of network traffic. Will have a think about it, it's been years since I did any Lua scripting in Redis.
  16. Change to U2F then save the user. When the page reloads, there should be options to set up the key.
  17. @Kiwi Chris Glad you found the solution. That's interesting though - can you post a link to the documentation you found regarding pcntl and apache?
  18. @Kiwi Chris I think it may be the file compiler as it seems to be translating the module so that PHP is looking for pcntl_signal() in the processwire namespace, hence the line from tracy: "ProcessWire\pcntl_signal()". It's also telling you where that line occurs. I've not used Tasker before, but I'm guessing you can edit that line and wherever you see "pcntl_signal()" being called, just prepend it with a backslash "\" character to put it in the global namespace. Doing so may reveal more errors about pcntl functions - but if that's the case, we know we are on the right track and you can do the same to them as they appear.
  19. Hi @Vilunki3000 Welcome to the forums. Did this start with the upgrade? If so, what version of Processwire were you using previously (which version worked for you?)
  20. I don't think you can prevent the output of those fields - but there is a trick you can pull to prevent them being editable (as well as hiding them using a CSS rule on the wrap classes.) If you override the preset values - but to the same strings as the preset would use anyway - then the form renders them with the disabled attribute. Like this.. <?php echo $page->comments->renderForm([ 'presets' => [ 'cite' => $user->name, 'email' => $user->email, ], ]); I haven't verified, but I believe that the comments fieldtype will replace any tampered fields in the posted form with the original preset, so this might work for you.
  21. Have you tried setting the "defaultAdminTheme" config setting to the theme you want? $config->defaultAdminTheme = 'AdminThemeReno'; // Or whichever theme you want users to have by default
×
×
  • Create New...