Jump to content

bracketfire

Members
  • Posts

    25
  • Joined

  • Last visited

Contact Methods

  • Website URL
    http://bracketfire.com

Profile Information

  • Gender
    Male
  • Location
    Charlotte, NC

Recent Profile Visitors

2,084 profile views

bracketfire's Achievements

Jr. Member

Jr. Member (3/6)

18

Reputation

  1. This is a great idea, we don't really use the publish/unpublished thing for these pages, but maybe a solution right under me nose ? Thanks!
  2. Occasionally we see an error which leads me to believe the site is trying to serve a page while (due to asynchronous background cron) it's being deleted. This particular page has around 100 fields, so page delete is foreach-ing across the fields. Site is on innodb. Has anyone ever wrapped delete in a transaction or anything to guard against this?
  3. Did you ever figure out this locking problem? I'm seeing the same behavior in our application. Any insight you can share would be appreciated.
  4. Mirza, did you ever figure out this locking problem? I'm seeing the same behavior in our application. Any insight you can share would be appreciated.
  5. I'm running 2.5.3 and hitting an error when trying to sort like this: sort=facility_page.title,sort=end_datetime using the title of a subfield, and getting back Column not found: 1054 Unknown column '_sort_page_facility_page_title.title' in 'order clause' It looks like the fix ESRCH references in this post will fix it. But I'm too much of a noob to figure out which release I need to upgrade to for the fix. Can someone smarter than me look it up?
  6. As part of a move to a new hosting provider, I've upgraded from 2.4.0 to 2.5.3, following the instructions and everything worked perfectly. I couldn't find anywhere the details of how PW knows to make schema changes during upgrades. I'm guessing that there's code somewhere that checks on every page load and calls a routine to make the changes needed for the new version? And that there's an indication in the DB somewhere indicating which version of PW it's been upgraded to? Thought it might be useful to post this question to get it documented for others. Since I'm going to be periodically re-importing the old 2.4.0 database underneath the new 2.5.3 code until "new version go-live", I assume it will make these schema changes each time I do that and subsequently load a page?
  7. I have a PageField that holds a single page. I've been trying to find the proper way to unset it, I've seen an example of using "unset" but that doesn't feel right, or very processwire-ish. Right now, I'm using $facility->region_page = new NullPage(); But this also, just doesn't feel right but appears to work. Is there a best practice for unsetting a pagefield?
  8. Just a quick note for future drive-by readers. For some reason $users = wire('pages')->find("template=user,roles=buyer,sort=email"); didn't work for me, but $users = wire('users')->find("template=user,roles=buyer,sort=email"); did. Not sure why.
  9. This is a great module, appears to work great and is exactly what I needed. I just tripped over something, not necessarily an issue with this specific module, but I'm getting this Notice: Undefined index: HTTP_USER_AGENT in <CUT>/modules/LoginPersist/LoginPersist.module on line 508 When I bootstrap Processwire for use in a backend cron job. It seems like in init() there should be some check to see if Processwire is running in the context of a web site. Not sure the best way to fix it, and I admit most users probably don't bootstrap PW for use in a cron. It's an edge case for sure. Here's what I did: public function init() { if (php_sapi_name() != 'cli') { $this->set('doLoginHook', true); $this->session->addHookAfter('login', $this, 'loggedIn'); $this->session->addHookAfter('logout', $this, 'loggedOut'); $this->_pruneLogins(); $this->attemptLogin(); } } Detecting if PHP is being used via CLI with php_sapi_name() is based off an answer on stackoverflow at http://stackoverflow.com/questions/343557/how-to-distinguish-command-line-and-web-server-invocation Great work on this module!
  10. Not quite sure where to post this, but here goes. I'm building a site that uses the Map Marker and Map Markup (Google Maps) modules to geocode addresses and save the lat/long. Is there a selector to find all pages who's lat/long is within a certain radius of another page? Has anyone done any work on such a selector? Maybe something like: $pages->find("template=Place,center=$page,radius=10"); I've found the math to do this, and if nothing like it exists I'll write it and can contribute it back to the community. Don't want to reinvent the wheel if somebody already has done this. Thanks!
  11. There's a little more to it. A seperate cron launches every minute, checks for auctions that are close (within 5 minutes) of closing, and launches this script in the background for each one. while(true) allows this script to poll the PW page for last minute bids, etc. and when the auction closes it breaks the loop, emails the winner, etc. and exits. So this script isn't actually a cron, it's launched by a cron to watch a specific page for a while, then exits.
  12. I see uncache() now, I guess what's confusing is that there's a page cache and a selector cache. It looks like you are right, in this case where I'm using a simple id=XX query, using uncache() on the specific page is probably enough. And yes, Craig, you are right - this is a loop in a cron job so it's a little different that a normal page generation deal that creates HTML for the browser.
  13. I've got a cron job that bootstraps processwire as shown in https://processwire.com/api/include/ It watches pages in a loop (auctions happening live) and checks fields periodically. while(true) { wire('pages')->uncacheAll(); $auction = wire('pages')->get($auction_id); It appears that without the uncacheAll(), changes to the page (changes made external to this script) aren't picked up by the get(). Is this the best way to assure I don't get cached pages? I found this method by looking at wire/core/Pages.php and didn't see a way to invalidate a certain page or pass an option to get that says to avoid any caching.
  14. Awesome explanation, thanks for taking the time to document this. I'm rapidly acquiring a real taste for this thing they call processwire
  15. I just Googled "Total Dumbass" and my picture came up
×
×
  • Create New...