Jump to content

fruid

Members
  • Posts

    402
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by fruid

  1. I have some html in a body field of a page including some <a> tag. For some reason the last bit of the link appears in the head in some meta tag and it breaks the page, the text appears on top of everything else. It must have to do with a faulty parsing of the html, meaning the closing of the <a> tag break the entire html but I have no idea how to fix it. The body is a CKEditor field. So it's like: <p>whatever whatever, <a href="https://www.domain.com/whatever" rel="noreferrer noopener" target="_blank">blablabla</a>.</p> and then I see on top of the page above all other content: blablabla. " /> Any ideas?
  2. Thanks, I already put the memory_limit to 320MB which didn't help. It works on my test-installation though, which however has a smaller database. So I guess if setting the RAM to 512MB works, that solution would only be temporarily as well. Any more ideas?
  3. I have troubles using AdminActions. I get… Allowed memory size of 268435456 bytes exhausted (tried to allocate 4096 bytes) (Zeile 1325 in wire/core/WireDatabaseBackup.php) However, if I disable automatic backup, it works fine. So now I wonder how to fix this properly, without disabling the automatic backup. Which memory is exhausted exactly? Hardly is it the server, we have unlimited storage. Thanks for help
  4. On the testing environment – subdomain, same server – I actually left the ChangeLog module active and the CSV-upload still works like a charm. I talked to the host, they don't see any difference in the server settings on both. They put the max memory for the live server. Still doesn't work. I compared the active modules on both installations, there is virtually no difference, in fact more modules are active on the testing environment which works fine. I deleted the cache in the assets folder, which is pointless, I reckon. Any help is appreciated.
  5. I uninstalled ProcessChangelog, but that didn't help. My client is still experiencing the same issue when uploading. Any more ideas what this error could mean?
  6. This might be a very basic question, don't know what's the easiest solution though… Let's say I have some pagetree like that: beverages > whiskey > > Jameson > > Ardberg > beer > > Heineken > > Leffe sweets > cake > > cheesecake > > chocolate > ice cream > > stracciatella > > raspberry I want an array of all these pages in order of appearance in the page tree. I tried: $homepage = $pages->get('/'); $items = $homepage->descendants("template=menu"); But when I loop through it foreach ($items as $item) { echo $item->title; } it first shows level 1, then level 2, then level 3 like this: beverages, sweets, whiskey, beer, cake, ice cream, Jameson, Ardberg, Heineken, Leffe, cheesecake, chocolate, straciatelly, raspberry Thanks for help!
  7. 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?
  8. 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.
  9. 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!
  10. 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!
  11. 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.
  12. 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.
  13. 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?
  14. 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.
  15. 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);
  16. 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.
  17. 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!
  18. @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.
  19. thanks, but what about the function sortOutEmpty(); ?
  20. Unforunately, it makes no difference, just tried it.
  21. @matjazp thanks for the suggestion, doesn't work either, just tried it. The only difference I see in your code is count($casts) instead of $casts->count() I think I also tried that before.
  22. nope, just tried. But thanks anyway. $limit = 6; $start = $limit * ($input->pageNum() - 1); $decider = 'body'; $allcasts = pages("template=cast"); // 35 $matches = $allcasts->find("has_parent=$page, sort=$sort"); // 32 $casts = sortOutEmpty($matches, $decider); // 31 $total = $casts->count(); // 31 $casts->setStart($start); // 0 on page 1, 6 on page 2, 12 on page 3, … $casts->setLimit($limit); // 6 $casts->setTotal($total); // 31 echo $casts->count(); // !!! 31 shouldn't that be 6 now that I set start and limit above? I thought ->count always returns the number of items on the current paginated page, not the total function sortOutEmpty($items, $decider) { $out = new PaginatedArray; foreach ($items as $item) : if ($item->$decider != '') : $out->add($item); endif; endforeach; return $out; } the items are not paginated, meaning they are not distributed among several pages but they are always returned in total. This pagination API is just garbage, it just never works when you build a custom PaginatedArray.
  23. If I start over and don't use any additional function, I need to put the decider!= in the selector which doesn't work. Also, even if it did work in the classic way (which seems to be the only way), as opposed to building a custom PaginatedArray, it would solve the problem now but not in the long run. Building a custom PaginatedArray and then paginate it properly is almost impossible.
  24. yes of course. I should have led with that.
×
×
  • Create New...