Jump to content

teppo

PW-Moderators
  • Posts

    3,259
  • Joined

  • Last visited

  • Days Won

    112

Everything posted by teppo

  1. Reviving an old topic, as I'm seeing something similar here at the moment. Sadly my current setup is far from clean test case, so I won't be going into too much detail, except that it seems to have something to do with Pages delete() method. Simply put it doesn't find actual repeater items, so they never get deleted. For an example page /processwire/repeaters/for-field-359/for-page-1646/ gets deleted, while one below it at /processwire/repeaters/for-field-359/for-page-1646/1391714225-7472-1/ remains. This is the original code that won't work for me: public function ___delete(Page $page, $recursive = false) { if(!$this->isDeleteable($page)) throw new WireException("This page may not be deleted"); if($page->numChildren) { if(!$recursive) throw new WireException("Can't delete Page $page because it has one or more children."); foreach($page->children("status<" . Page::statusMax) as $child) { If I change that last line to this, repeater items are found and properly deleted: foreach($page->children("include=all") as $child) { I'm probably missing something here, especially since I've no idea why status selector is used here or why it doesn't seem to find the repeater page in question, but at least for me this fixes the problem. Might cause some new ones, though, don't know about that yet..
  2. @Anssi: sounds like an issue with secure connection. Google is using HTTPS for all search results and RFC 2616 clearly states that when going from HTTPS to HTTP referer header should not be preserved: One exception to this is referer meta tag, which Google is actually using to provide some basic referer information for browsers that support this -- namely the domain that a request originated from. There's not much information you can get out of that, though Simple test: open dev tools, switch to net panel (or whatever it's called in your particular flavour of tools), set up filter (if available) to only show documents, enable "sticky" logging ("Preserve Log upon Navigation" in Chrome) and click any Google search results. Only the originating domain should be included with request headers.
  3. @dragan: if you're literally using var_dump(), it should be noted that it doesn't return anything. In order to store it's value in a variable you'd need to use output buffering or some other trick. Another option is to use print_r() with return param set to true. Main difference between var_dump() and print_r() is that var_dump() provides more information about the data types involved, while print_r() only outputs content. Edit: you should also take a look at this comparison between var_dump(), print_r() and var_export().
  4. Should've done this earlier, but I've just pushed to GitHub updated version of the module. This version is set to require "changelog" permissions and create it when the module is installed. Dragan and any others who've already installed the module: I suggest that you get the latest version, add aforementioned permission manually and then apply it to those roles that should be able to access changelog page.
  5. One (definitely not fool-proof but still useful) approach is to rely on those same proxy sites and implement a simple blacklist. Hide My Ass! has a nice list of public proxy site IP's you can use -- and, surprise surprise, even buy as a .txt file. For $25 they even promise to email you updated copy every day "for life". How's that for a business model?
  6. “Failed asserting that true is false.” That sounds about right.

  7. RT @GonzoHacker: Human Resources will now be known as Meat Based Machine Maintenance. Please let your supervisor know if you require servic…

  8. RT @dinet: Help get @processwire packaged by Bitnami. You can vote at http://t.co/jtElRFiiWi

  9. Two days to go and #ProcessWire is leading Bitnami contest. There's still time to vote, though: http://t.co/K3EJf8NaEm

  10. RT @smashingmag: A JavaScript library to make absolutely positioned elements attach to elements in the page, efficiently. http://t.co/Z3Wq1…

    1. MatthewSchenker

      MatthewSchenker

      I'd like to see it! Can you fix the link?

  11. RT @codinghorror: I love phone apps for websites because it is just so much fun to learn two totally different and incompatible UIs for doi…

  12. Once again on a tight schedule here, but first of all, I'd start with making sure what character sets are actually in use. If not UTF-8, you can convert data to it with relative ease, though it needs to be done once for database, then on table-by-table basis for existing tables. This is important to keep in mind, though: (Source of quote: http://dev.mysql.com/doc/refman/5.6/en/alter-table.html.) Hope this helps a bit. I'd be happy to take closer look at this at some point too, now I'll have to run
  13. Slightly unrelated, but is there an actual warning or what? Just checking, 'cause in that case we'd be seeing *a lot* of these
  14. RT @jeansnow: Fun 3-part history of consoles from TIME: http://t.co/sPpILgtIw5

  15. Glad to hear that you found a solution, but in a case like this I'd really suggest taking a look at bootstrap method. It's perfect for tasks like these, where you don't really want or need actual page, just code that can access data and/or features of ProcessWire.
  16. This is one of those situations where it would be awfully helpful to really see what's the full context, pages and fields you've got etc. but based on what you've posted here: That error seems to suggest that your second foreach loop (assuming it's actually on line 5) gets invalid argument, i.e. $bora->user_select_asset isn't something you can iterate with foreach. The main problem here might be the way you're trying to find users; try one of these instead: // this one: $borago = $pages->find("template=user, user_select_asset.count!=0, include=all")->remove($page); // or this one: $borago = $users->find("user_select_asset.count!=0")->remove($page); If that doesn't help, I'd suggest that you add a check before second foreach line, where you output something like var_dump($bora), var_dump($bora->user_select_asset) and/or get_class($bora->user_select_asset) just to check what you're actually dealing with. If echo doesn't work there, try wrapping the command with die() (or writing output to log file, here's one example for implementing that.) Also: make sure that all your variable and template names are properly written; for an example in your first post you mentioned template name "addAsset", while in your code you're trying to find pages with template "addase". Has the name changed or is it misspelled here?
  17. teppo

    Book Recommendations

    PRINT "I LOVE MY COMMODORE" You key in this and press RETURN I LOVE MY COMMODORE The computer prints this READY ▋ Admittedly this is a border case for a book-related thread, but I simply couldn't resist after todays comments in the admin theme thread: anyone remember that user manual C64 shipped with? The one that was part how-to guide for using C64.. but mostly an introductory book for Basic programming? Well, for those who do remember (or don't but would like to) it's available as an HTML version from lemon64.com.. and commodore.ca has even more of that same stuff in PDF format. They really don't make manuals like that anymore (probably for a good reason -- just imagine a modern PC or Mac shipping with C/C++/Objective C manual) but that's also one of the few manuals I remember reading from cover to cover more than once.. and actually enjoying it "Before you can use sprites it's important that you understand a few general things about how computers work.."
  18. I've just pushed to GitHub new version of this module. This update includes some minor improvements, such as storing version data for pages starting from the moment they're added, and as a bigger addition $page->snapshot() feature exactly as described by @SteveB earlier: echo "Page title now: {$page->title}<br />"; $page->snapshot("-1 week"); echo "Page title last week: {$page->title}<br />"; I've been working on and off this for a while now and actually had to write a bunch of PHPUnit tests just to make sure that everything works as expected (too many moving parts to keep track of manually.) There's still some work to do here and especially performance-wise more tests to be made, but at least this shouldn't disrupt how other parts of the module work
  19. That error is caused by the fact that you run this file without involving ProcessWire at all. You can't just run template file "standalone" and expect it to automatically load ProcessWire, you know Solution @horst provided above is most likely what you need here (or external / real cron job instead of this awfully limited scheduler thing you're using now). Then again, if this is the only reason you need that template, i.e. it doesn't need to be web-accessible, you could forget whole template and page thing and simply place a PHP file somewhere your scheduler can access (such as your PW root directory) and in that file bootstrap PW and write any program logic you need. Point your scheduler to that file and you're all set.
  20. +1 for "modern" for the reasons Adrian mentioned.. and because the "warm" color scheme gives me this nostalgic feeling I can't quite explain. It feels comfortable (kind of like 80's product design and advertising), but doesn't really match my image of ProcessWire as a present-day top-of-the-line software product
  21. minimize.pw (@minimizepw) is an image compression service for #ProcessWire. Commercial, but free for small-scale use.

  22. Some time ago, while debugging a misbehaving site, I found out that one user had a habit of hitting shift + enter at the end of each line in the editor. That made sense as an attempt to gain more control over the typography, but it also explained the situation.. especially since the site in question was responsive. Making each <br /> visible could've prevented that whole mess -- or at least made it easier to understand why it was happening
  23. PuPHPet seems very interesting; setting up web development environments via simple GUI: https://t.co/Rmkyk5JNRo

  24. RT @spinlock: Teaching my kid the ins and outs of iOS development. Lesson one: forming strong opinions and arguing on the internet.

  25. Agreed -- and I'd like to add that in some cases even the page names and/or titles themselves could be considered confidential data. I'm thinking about things like closed intranet for managers, working group discussions etc.
×
×
  • Create New...