flydev

Members
  • Content Count

    662
  • Joined

  • Last visited

  • Days Won

    21

flydev last won the day on June 25

flydev had the most liked content!

Community Reputation

1,262 Excellent

4 Followers

About flydev

  • Rank
    0xDEADBEEF
  • Birthday 09/21/1983

Profile Information

  • Gender
    Male
  • Location
    France

Recent Profile Visitors

3,258 profile views
  1. Hi, without a loop, you could use selector subfields to find your options like the following: $page->repeater->find("sub_repeater.field=value"); So for you code : $option_name = $p->shop_product_options->find("shop_product_options_option.global_text={$option['name']}"); if(is_null($option_name) || !count($option_name)) { continue; } else { // do stuff }
  2. flydev

    Hi, read that:
  3. flydev

    Amazing.. I just asked to my boss if he still has something, telling me that all the things came to the trash some time ago, but he told me that he still have a Sinclair ZX-81 with 1KB of RAM and an 16KB RAM extension (http://oldcomputers.net/zx81.html). I will have an answer tomorrow. If you're interested, just tell me. For the C64, it look like we can find some machines here in France. After the hardware part
  4. Sorry for the short answer, i am on mobile. Shouldn't be : $repeaterDay->save('film_times'); ?
  5. A fast answer, suggestion. From there : https://dev.mysql.com/doc/refman/5.6/en/charset-charsets.html mysql> SHOW CHARACTER SET; +----------+-----------------------------+---------------------+--------+ | Charset | Description | Default collation | Maxlen | +----------+-----------------------------+---------------------+--------+ | latin1 | cp1252 West European | latin1_swedish_ci | 1 | | utf8 | UTF-8 Unicode | utf8_general_ci | 3 | | utf8mb4 | UTF-8 Unicode | utf8mb4_general_ci | 4 | +----------+-----------------------------+---------------------+--------+ My bet is that you might have a 4-byte characters in a keyword which is actually triggering the error where MySQL utf-8 character set only supports 3-byte characters. My recommendation is to convert your database to the utf8mb4_general_ci collation. PS: Backup, Backup, Backup Edit: Blog post found on ProcessWire: https://processwire.com/blog/posts/pw-3.0.15/#utf8mb4-considerations Good luck
  6. flydev

    When we submit the login form of your admin page, the response is a 404 error code. Also your attempt to visit the reset.php failed, you might have an issue with the .htaccess file. You could try the following : backup everything create a file - disable-procache.php - on the root web dir (along the index.php file) with this code: <?php namespace ProcessWire; require_once('./index.php'); // get the module $pc = $modules->get('ProCache'); // turn off procache $pc->cacheOn = false; visit the page at http://yourwebsite.com/disable-procache.php replace the .htaccess file with this https://github.com/processwire/processwire/blob/master/htaccess.txt (do not forget to rename it to .htaccess) try to login - result ?
  7. flydev

    That's good to know about MAMP Pro, thanks ! About PureVPN, if you feel concerned by privacy things, check this website for a short - bad/sad - review about PureVPN : https://restoreprivacy.com/purevpn-review/
  8. For modules, what @dragan said. Also in getModuleInfo(), you can add : 'page' => array( 'name' => 'mymodulepage', 'parent' => 'setup', 'title' => 'MyModulePage' ), And how do you do that ? The reason is because the page added require a ProcessModule to be defined.
  9. I don't fully understand the issue, there is an example of buidling a PageArray, inserting pages, looking for a given page (item), removing it from the PageArray : // example $allpagesarray = new PageArray(); // loop to get all Page tree object and insert them in the PageArray for this example foreach($pages->get(1)->children as $p) { $allpagesarray->add($p); if(count($p->children)) { foreach ($p->children as $cp) { $allpagesarray->add($cp); } } } echo "count allpagesarray: {$allpagesarray->count}<br>"; // new PageArray containing some Page object $productpages = new PageArray(); foreach ($pages->get('/products/')->children as $prod) { $productpages->add($prod); } $firstprod = $productpages->first; // the Page object we are looking for in $allpagesarray if($allpagesarray->has($firstprod)) { echo "page found (id:$firstprod->id), removing it from PageArray<br>"; $allpagesarray->remove($firstprod); if($allpagesarray->not($firstprod)) echo "page (id:{$firstprod->id}) removed<br>"; } // check if the Page still exist after removing it from the PageArray if($allpagesarray->not($firstprod)) { echo "page not found (looking for id: {$firstprod->id})<br>"; } else { echo "page still found (id:{$firstprod->id})<br>"; } echo "count allpagesarray: {$allpagesarray->count}<br>";
  10. Yes, to be more precise, as it look like you want to access this array from a template, you will want to set this array as a property to the right page id or template context. Check : wire()->addHookProperty(...); https://processwire.com/api/ref/wire/add-hook-property/
  11. Hi, I think we could say that ready.php is one of the file where we can define hooks to alter templates. It could also be a module. So yes, it's possible and it's the way to go and it depend only on the context you put your hook on.
  12. flydev

    Sorry @MarcoPLY I didn't saw your last ping! This is the correct way to call the hook, put it in ready.php as you did then, go to Modules > Refresh if you still can't see the hook. Code : wire()->addHookAfter('Pages::saved', function(HookEvent $event) { // Get the object the event occurred on, if needed $pages = $event->object; // Get values of arguments sent to hook (if needed) $page = $event->arguments(0); // your code: $page = $event->arguments[0]; bd($page); // tracy debug: User page object if ($page->template == "user") { $mc = wire('modules')->get("SubscribeToMailchimp"); $email = wire('user')->email; $subscriber = [ 'FNAME' => wire('user')->pad_firstname, ]; $mc->subscribe($email, $subscriber); bd($mc); // tracy debug: MailChimp object } });
  13. flydev

    Correct, try to compare your hook-code and the one on the documentation: https://processwire.com/api/ref/pages/saved/ hints: function, HookEvent, $pages, $event, object; besthintever: tracy
  14. flydev

    Ok this is the issue. Your problem is a known bug in SOAP extension and you should update the version running on your server to at least PHP 7.1.14 (known to me where the bug was fixed and its working). So just to be clear, PHP 7.0 branch contain the bug. To fix it, update the server PHP version. And FYI, a good habit is to develop with the same environment to avoid those head scratching moment - https://bugs.php.net/bug.php?id=70469 Submitted: 2015-09-10 13:50 UTC Modified: 2017-11-22 22:14 UTC https://github.com/php/php-src/pull/2899
  15. Hi, Are you on ProcessWire 3 ? If yes then write at the top of the check_code.php the following code : <?php namespace ProcessWire; What's the error(s) ? - Assuming the problem is calling this file, modify your call(s) to this file like that : <!-- example for form action --> <form method="post" action="<?= $config->urls->templates; ?>download/check_code.php"> [...] </form> <!-- example for redirect --> <?php $session->redirect($config->urls->templates . 'download/check_code.php');