Jump to content

fruid

Members
  • Posts

    396
  • Joined

  • Last visited

  • Days Won

    1

fruid last won the day on November 5 2020

fruid had the most liked content!

Recent Profile Visitors

925 profile views

fruid's Achievements

Sr. Member

Sr. Member (5/6)

30

Reputation

  1. I'm having a similar issue as @ceberlin when uploading a CSV file to import pages Allowed memory size of 268435456 bytes exhausted (tried to allocate 4096 bytes) (Zeile 1325 in wire/core/WireDatabaseBackup.php) (I started there: https://processwire.com/talk/topic/26256-allowed-memory-size-of-268435456-bytes-exhausted-tried-to-allocate-4096-bytes-zeile-1325-in-wirecorewiredatabasebackupphp/ which brought me here.) Is there any way to fix this issue other than deactivating/uninstalling the module?
  2. how do I do that? I do indeed use that very module ProcessChangelog. Might that be the problem? That module is actually not installed in said test environment, so it looks like that could be it. I'd love to better understand this… Not sure if the database is huge but it will be much bigger soon once we migrated everything.
  3. Hi people, my client reports an issue when trying to import a CSV-file via a custom action I wrote on top of the ProcessAdminActions module. This is the error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 4096 bytes) (Zeile 1325 in wire/core/WireDatabaseBackup.php) I had put a copy of the whole website on a subdomain on the same productive server for testing purposes. Now I tried to upload the same CSV-file there with no issues. We encountered this issue before I think I already reached out here, just cannot find the thread anymore. A working solution I think was to update the post_max_size etc. within the php.ini file, but that seems suboptimal, my client, who is quite tech savvy, thinks there must be a bottleneck somewhere. Any ideas? Thanks for help!
  4. I think I made a tiny progress, but still far from satisfying… I get… Notice: Undefined index: mc_gross in /home/.sites/66/site2760076/web/dev/site/assets/cache/FileCompiler/site/modules/PaymentPaypal/PaymentPaypal.module on line 87 I use the exact code as described in the github README example and set the get-variable ?step=process manually just to test. I'm not sure the above is even a big issue, but it's not working anyway, or hard to tell exactly. No sign of payment in my sandbox account anyway. A couple of questions… I set my paypal account to send IPN upon payment, does that even work here? I ask because it says: 'summary' => 'PaymentPaypal - using standard payment API and PDT for verification', so I wonder if those are the exclusive alternatives to IPN. And then, why do I send an address to paypal? To my understanding, a user would pay with their paypal account in which they stored their address beforehand anyway, so why send it? Can paypal separate a shipping and a billing address? Because if not, then one could make an argument as to why that makes sense after all. Next looking at the code from the github example and the module code itself, it's hard to tell where I am in the transaction with all that back and forth to and from paypal. Is data[mc_gross] missing in the array/object sent to paypal or coming from paypal? I guess it's the former. Still, would be great to have some more documentation because it's hard enough to work with paypal as it is. Thanks for help!
  5. a bit late to the party here… hello everyone. I'm currently building or I just built a custom checkout flow from scratch, mostly frontend with automatic order and confirmation email. I also integrated a paypal button following the tutorials from paypal.com. This kinda works but it's also the only thing that doesn't quite yet work. I still need to figure out how to get the shipping and billing address from paypal so I can include it in the order and confirmation email, because in the checkout flow the address form is presented only for payment methods other than paypal (the reason being that paypal already stores these details in the user's account). So apparently I need to use the IPN functionality from paypal and parse that notification, also send it back unparsed, wait for a validation, check the ID and whatnot, all that good stuff. I'm not sure what this module here actually help with. Can it do the IPN handling? I went through the source code on github but it's still not clear to me. Any more suggestions or should I keep writing from scratch at this point? – also learned about padloper just now 😅😐 so maybe next time I give this one a shot.
  6. I need to correct myself, the above, as expected, doesn't work or at least very inconsistently. So I'm now using the version with the sortOutEmpty function, which is a working solution. The downside I believe is that it's all loaded in memory now before paginating, so I'm still on the lookout for a better solution. Thanks so far.
  7. forget the part where I said I need to filter it twice because the second part would not be paginated anyway, just have a limit, that's all. The way you explain it, I think I didn't get it too wrong after all, just wasn't so lucky implementing it. So how would I go about paginating it without storing everything in-memory but instead accessing the database directly (?) given the above starting point?
  8. yes! I can confirm that @matjazp's solution works for me as well! As you might be able to see when comparing my actual code and the example / prove of concept code, I was getting close. As for the load from db or load from in-memory, I've always been confused about this stuff. If you don't mind my asking: is that basic php knowledge or specific to PW? I actually need to load the pages and filter them twice because I have two subsections to be displayed on the page. So I don't know how to do that properly, without loading all at once. And I don't know how I would accomplish all of this in the given scenario, with the custom PaginatedArray and all, but I'm curious to find out and appreciate your input. That said, I can also confirm that works now. I'm almost certain though that I've used this syntax before with the empty single quotes so I'm very sceptical. Or I'm delirious. It's like the first approach one would use before ending up with what I did (building that function sortOutEmpty() etc. so I seriously doubt I didn't try that out before.
  9. yes of course that works. But please, you try this now: $items = $pages->find("id>1"); $home = $pages->get("id=1"); $customPaginatedArray = new PaginatedArray; foreach ($items as $item) : if ($item->parent == $home) : $customPaginatedArray->add($item); endif; endforeach; // should return an array of pages that are direct children of the homepage $total = $customPaginatedArray->count(); $customPaginatedArray->setStart(0); $customPaginatedArray->setLimit(10); $customPaginatedArray->setTotal($total); foreach ($customPaginatedArray as $c) : echo $c->title . '<br>'; endforeach; $pager->render($customPaginatedArray);
  10. without the start specified, the pager also doesn't work. Right now it's just the results that are not split up among the pages.
  11. Let's step back for a second. I need to select pages where a certain field is empty. $pages->find("template=cast, has_parent=$page, start=$start, limit=$limit, sort=$sort, body!="); doesn't work So I created a PaginatedArray and looped through the items. If the field (body) in question is empty add them to the PaginatedArray. But then I – correct me if I'm wrong – need to use the ->setStart() ->setLimit() in order to paginate, which simply doesn't work. That's all I need. If I get it sorted without the methods, good, but the methods remain to be proven functional. Thanks!
  12. @adrian thanks but the linked topic is quite unrelated, I read through it, even the linked topics within in. I don't see how the approaches discussed can be helpful here. I'm not trying to merge two array objects, I'm trying to build an array object where a specific field is not empty and then paginate it. I challenge whoever reads this to show me an example where a custom PaginatedArray is successfully paginated afterwards using ->setStart() ->setLimit() and ->setTotal() because I don't remember seeing it working. I always only succeeded by using selectors and never the methods.
  13. thanks, but what about the function sortOutEmpty(); ?
  14. Unforunately, it makes no difference, just tried it.
×
×
  • Create New...