Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by NorbertH

  1. Finally deleted all those pages using transactions: <?php namespace ProcessWire; include "index.php"; $dePages = wire('pages')->find("parent=/einstellungen/berufi/"); echo $dePages->count()."\n"; $i=0; try { $database->beginTransaction(); foreach ($dePages as $dePage){ echo $i++. " ".$dePage['title']."\n"; $dePage->delete(); } $database->commit(); } catch(\Exception $e) { $database->rollBack(); } Script took 7 Minutes to run , the actual query execution took about 7-10 seconds at the end of the script. I guess Transactions are helpfull at deleting pages too . What i did not try was to trash them first.
  2. The variant whithout transactions (and whithout save()) took about 45 seconds to run. Using transactions (not really using them as save() is commented out ) took about a 45 seconds to run too. Both throw an error: PHP Warning: touch(): Utime failed: Permission denied in /volume1/web/personalverwaltung/wire/core/FileCompiler.php on line 1063 Edit: The error message has nothing to to whith the scripts , just an issue whith the test server.
  3. Found a nice link about this topic: https://stackoverflow.com/questions/14675147/why-does-transaction-commit-improve-performance-so-much-with-php-mysql-innodb
  4. Hmm ok , did some testing . Testserver is a synology disk station whith 8 G ram. The import ccript is pretty simple : <?php namespace ProcessWire; include "index.php"; // Include PW include "berufe.php"; // Simple array with about 25000 Job names /* $berufe = array( array('id_beruf' => '1','berufsbezeichnung' => 'Aalbrutzüchter/in','kldb2010' => '11412'), array('id_beruf' => '2','berufsbezeichnung' => 'Aalfischer/in','kldb2010' => '11422'), array('id_beruf' => '3','berufsbezeichnung' => 'Aalräucherer/-räucherin','kldb2010' => '29242'), ... */ foreach ($berufe as $beruf){ echo $i++. " " .$beruf['kldb2010']." ".$beruf['berufsbezeichnung']."\n"; $p = new Page(); $p->template = 'berufsbezeichnung'; $p->parent = '/einstellungen/berufi/'; $p->title = $beruf['berufsbezeichnung']; $p->schluessel = $beruf['kldb2010']; $p->save(); } It took about 60 minutes to import using a PW installation whith Inno DB It took about 40 minutes using an installation whith MyIsam Now i changed the script to use transactions: <?php namespace ProcessWire; include "index.php"; // Include PW include "berufe.php"; // Simple array with about 25000 Job names try { $database->beginTransaction(); foreach ($berufe as $beruf){ echo $i++. " " .$beruf['kldb2010']." ".$beruf['berufsbezeichnung']."\n"; $p = new Page(); $p->template = 'berufsbezeichnung'; $p->parent = '/einstellungen/berufi/'; $p->title = $beruf['berufsbezeichnung']; $p->schluessel = $beruf['kldb2010']; $p->save(); } $database->commit(); } catch(\Exception $e) { $database->rollBack(); } On InnoDB using transactions the script finished in about 10 Minutes. It seemed like the actual DB operation that happened after creating the transaction only took a few seconds, as the almost script imediately ended after the last echo. Possibly transactions are worth a closer look, if we do massive data handling.
  5. Processwire 3.0.98 Calling /processwire/page/ Puts me in an endless loop. It redirects to processwire/page/?login=1 Over and over again.
  6. If i find some time i give it a try to import the pages whith transactions , maybe in 1000 entries blocks.
  7. Made a test installation whith MyIsam , was about 20% faster .
  8. I had imported about 10000 Pages (realy simple ones 2 text fields only ) into PW using child batch editor and it took about 1 hour whith multiple script timeouts. Moved em to trash but emtying the trash run into timeout again after about 10 minutes. So i started a bash php script ($page->emptyTrash()) but after half an hour it is still running. Pagetree shows only about 4000 Removed from trash right now. ProcessWire 3.0.98 Running on InnoDB (Mariadb 10) Any Ideas ?
  9. When setting description fields to 0 the download links are not displayed in backend. ProcessWire 3.0.98
  10. But still they got an append() and prepend() method ... prepend() even seems to remove files that are already in the original array , maybe that would be a nice feature for append () too? Maybe even an option to add custom keys , not just those md5 strings maybe like add($filename, $customkey). That would allow to make a method to add after a certain key like addAfter ($filename, $customkey, $afterkey). That would make it possible to add scripts in an nicely defined order.
  11. As $config-scripts is a wire array objekt wouldnt it be easier to use : WireArray::prepend() WireArray::append() to controll if the new script is loaded first or last ?
  12. Thanks to all , using notifications for now 🙂
  13. Ok, if "dev talk " is the better place, some moderator hopefully moves this. Anyway thanks a lot !
  14. Another issue is that the element is only faded , so if you have several warnings , they stull use up their space after they have faded. If you close em they are removed.
  15. Cool that does it , but how i set animation time ?
  16. UIKIT3 Docs: https://getuikit.com/docs/alert#component-options Seems to say that you can animate this using component options , but i really can't find out how. Trying to avoit to add to much custom scripts for just an alert.
  17. Hi there I am using an UIKIT alert box in a frontend template: <div class="uk-alert-success uk-text-center" uk-alert> <a class="uk-alert-close" uk-close></a> <h3><?=$Success.$SuccessText?></h3> </div> It already has a close button , but i want it to disappear after some seconds even if you don't close it manually. UIKIT docs seem to say its possible , but i cannot find an example on how its done. Thanks in advance !
  18. Thanks alot ! The idea of looking at the console solved the problem , as i had javascript turned off in all of my browsers So i guess we can close this now .
  19. I have a PW page that is about 2 - 3 Years old . After an upgrade to Version 2.6 all Pages and modules where gone in Admin backend. As i had no time to look after the page i left it like it was for quite a while. Now that i needed to get the Page online again i searched whith google anf fount that i should upgrade the page to PW 2.7.3 As the Upgrade to 2.6 was done in a hurry , its perfectly possible that i accidentallly upgraded from 2.0 to 2.6. Please have a look at the images to see the desaster in full color ....
  20. On Install i get : Parse error: syntax error, unexpected '[' in /somepath/site/modules/FieldtypeFontIconPicker/InputfieldFontIconPicker.module on line 22 I guess this is because that server uses php 5.4. that does not support the new [] Syntax. The funnie thing about that is that it should support it !
  21. Maybe its a solution to export the whole page to a Profile and install it whith a clean 2.6?
  22. @evan Thanks, that helped me out for the moment! @ryan Actual may version is a 2.5.28 Def that was upgraded in multiple steps to always the latest def version, i tried upgrading to 2.6 but the error was still there. Later i downgraded using a backup as 2.6 had some other issues. (couldn't deninstall the old comments manager ) . Maybe its mentionable that i echoed the $field->schemaVersion and it just gave me a Zero(0). I guess that schould be a 5. I remember something from PHP manual : try { $error = 'Always throw this error'; throw new Exception($error); // Code following an exception is not executed. echo 'Never executed'; } so maybe $schemaVersion = 5; is never executed as all tests fail and so its never saved ? EDIT: Did a few more tests and it does not get executed. I guess thats the reason why the error only states something about upvotes and never about downvotes as even downvotes isn't checked. EDIT2: I had the Funnie Idea of simply setting $schemaVersion manual. $schemaVersion = 5; //I ADDED THIS ! if(((int) $field->schemaVersion) < $schemaVersion) { $this->message("Updating schema version of '{$field->name}' from $field->schemaVersion to $schemaVersion", Notice::log); $field->schemaVersion = $schemaVersion; $field->save(); } This led to a few little Errors where the most interesting might be : TemplateFile: Field comments is not saveable because it is in a specific context
  23. I just upgraded to PW 2.6 The new Comments Admin requires me to remove this Comments Manager , but when i try to uninstall it i get a : Fatal error: Class 'Comment' not found in /var/www/web207/html/site/modules/ProcessLatestComments/ProcessLatestComments.module on line 59 Comments Module is installed.
  24. When using the Comments Module i get Errors at all actions that have to do whith comments, for example editing the field settings. Session: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'upvotes' FieldtypeComments: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'upvotes' ProcessWire 2.5.28 dev Right now there are no comments posted on the page yet!
  25. Great work , no problems so far!
  • Create New...