Jump to content

neonwired

Members
  • Posts

    54
  • Joined

  • Last visited

Everything posted by neonwired

  1. Is there a way to protect new pages by default?
  2. I disagree, it's perfectly legitimate to use it. I don't do code snobbery.
  3. I'm aware of that. However I doubt deleting the entire entry as a result is intended.
  4. Found a bit of a bug. If you add javascript:void(0) in the link field in a custom link it deletes the item.
  5. i'm an idiot, having spaces apparently breaks the selector.
  6. Error: Exception: Unknown Selector operator: '' -- was your selector value properly escaped? field='id', value='!= 9022', selector: 'template=city,id != 9022,id != 9011,id != 9028,id != 1099,' (in /opt/bitnami/apps/processwire/htdocs/wire/core/Selectors.php line 357) #0 /opt/bitnami/apps/processwire/htdocs/wire/core/Selectors.php(401): ProcessWire\Selectors->create('id', '', '!= 9022') #1 /opt/bitnami/apps/processwire/htdocs/wire/core/Selectors.php(158): ProcessWire\Selectors->extractString('template=city,i...') #2 /opt/bitnami/apps/processwire/htdocs/wire/core/Selectors.php(144): ProcessWire\Selectors->setSelectorString('template=city,i...') #3 /opt/bitnami/apps/processwire/htdocs/wire/core/PagesLoader.php(188): ProcessWire\Selectors->init('template=city,i...') #4 /opt/bitnami/apps/processwire/htdocs/wire/core/Pages.php(225): ProcessWire\PagesLoader->find('template=city,i...', Array) #5 [internal function]: ProcessWire\Pages->___find('template=city,i...') #6 /opt/bitnami/apps/processwire/htdocs/wire/core/Wire.php( This error message was shown because: site is in debug mode. ($config->debug = true; => /site/config.php). Error has been logged. i've reduced it to the simplest selector and still the same error. My version is 3.0.42. The following work template=city,id=9022,id=9011,id=9028,id=1099 template=city,id!=9022 so it seems the issue is with having multiple does not equal clauses.
  7. <b>Fatal error</b>: Exception: Unknown Selector operator: '' -- was your selector value properly escaped? field='id', value='!=9022', selector: 'template=city,sort=random,start=0,id!=9022,id!=9011,id!=9028,id!=1099,limit=8' (in /opt/bitnami/apps/processwire/htdocs/wire/core/Selectors.php line 357) I'm getting this confusing error with a selector, it seems to be implying that id isn't a field which is obviously not right. Any idea what might cause this bug?
  8. Just had an entire site go down with the following error : Error: Call to a member function hasPermission() on null (line 1289 of /opt/bitnami/apps/processwire/htdocs/wire/core/Modules.php) Any idea what is causing this?
  9. oh yeah, i was expecting to see the search bar and icon but that's only on single selects not multiple.
  10. Is there a way to enable the search?
  11. You're not really making them look non-random, it's just so you can paginate a random set of results, without a seed it would just pick a whole new set of random results on every page and potentially pick the same ones again which is definitively a usability issue. What i'm doing is creating a page that uses ajax to load more items when scrolling downwards, i can't bootstrap all as there are thousands of items so without using a seed the best suggestion is Robin's to load IDs. In wordpress you can pass the seed when you order by random, would be nice if processwire had something similar
  12. But it's still sorted randomly. So unless you can use a seed the order will change on every page.
  13. $items = $pages->find("template=city, sort=random, limit=20"); I'm using find to get 20 random items, is there a way to use a seed so i can paginate them?
  14. In the end i did it by getting all the categories adding a count property and then sorting and limiting after. Not sure what impact this will have on speed as it's getting all the categories first. $categories = $pages->find("template=category"); foreach($categories as &$category) { $count = count($pages->find("template=tour,type=".$category->name)); $category->tours = $count; } $categories->sort("-tours"); $categories->filter("limit=6");
  15. I have a category template and each page can be associated with multiple categories using a page field type. i have this in php : - $categories = $pages->find("template=category, limit=6"); I want to sort the results by the amount of pages each category has, is there a way to do this in a selector or is there a better way of doing this?
  16. Doesn't look like there's any redirects. $_POST is fine as well. It seems i can iterate through it or call a variable directly but if i dump or print_r $input->post() i get an empty object. Weird.
  17. i'm still getting a blank $input->post() not just with ajax calls but regular calls also. $input just doesn't seem to ever be populated at all. Any idea what's going wrong?
  18. jquery $.ajax({ type: 'get', url: config.InputfieldLocations.url, data: { id: $(this).val(), ajaxfunction: 'getcities' }, success: function(data) { console.log(data); } });
  19. Thanks, i'm actually sending a get request. I've tried $this->input, $this->wire->input, $this->wire('input') all return NULL.
  20. I'm trying to call an ajax function for an inputfield using Soma's method below by intercepting the call in the module init function but for some reason $this->input is always NULL. public function init() { parent::init(); $dir = dirname(__FILE__); require_once("$dir/Location.php"); require_once("$dir/LocationArray.php"); $this->wire('config')->js('InputfieldLocations', array( 'url' => "/admin/locationmodule/ajax" )); if ($this->config->ajax && $this->input->ajaxfunction == 'getcities') { header('Content-Type: application/json'); echo $this->get_cities(); exit; } }
  21. I've updated the config file and cleared the sessions directory but this error is still showing after moving from a dev subdomain to a live domain.
  22. I'm having trouble with the formatted value of certain image fields. Regardless of what i select it always returns a PageImages object. Is this known to be buggy and is there a solution?
  23. Can anyone get bgset to work, it just always uses the fall back background image for me. Nevermind. Sorted it.
  24. It was extending WireData but i'd forgotten to add namespace ProcessWire; Thanks for your help.
  25. I'm trying to write my first module and am a bit confused about how to make a variable available to templates. I've seen both of these in the init function and neither seem to work for me. wire("fuel")->set("html", $this); $this->wire->set("html", $this); $html is always NULL in my template. Which is correct or are both wrong?
×
×
  • Create New...