Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by marc1n

  1. I have PW dev-branch 2.5.26 on production but I discover bug which forces me to switch to master branch. How can I make this switch? Can I just replace wire directory?
  2. This is certainly a bug in PW 2.5.26 (dev branch only). I reported it here: https://github.com/ryancramerdesign/ProcessWire/issues/1103
  3. I discovered that in method Pages::savePageQuery calling executeQuery($query) does not throw exception at all (which is unexpected because catch block has code calculating new unique name): do { $result = false; $errorCode = 0; try { $result = false; $result = $this->executeQuery($query); } catch(Exception $e) { $errorCode = $e->getCode(); // while setupNew() already attempts to uniqify a page name with an incrementing // number, there is a chance that two processes running at once might end up with // the same number, so we account for the possibility here by re-trying queries // that trigger duplicate-entry exceptions if($errorCode == 23000 && ($page->_hasAutogenName || $options['adjustName'])) { // Integrity constraint violation: 1062 Duplicate entry 'background-3552' for key 'name3894_parent_id' // attempt to re-generate page name $nameField = 'name'; // account for the duplicate possibly being a multi-language name field if($this->wire('languages') && preg_match('/\b(name\d*)_parent_id\b/', $e->getMessage(), $matches)) $nameField = $matches[1]; // get either 'name' or 'name123' (where 123 is language ID) $pageName = $page->$nameField; // determine if current name format already has a trailing number if(preg_match('/^(.+?)-(\d+)$/', $pageName, $matches)) { // page already has a trailing number $n = $matches[2]; $pageName = $matches[1]; } $page->name = $pageName . '-' . (++$n); $query->bindValue(":$nameField", $page->name); } else { // a different exception that we don't catch, so re-throw it throw $e; } } } while($errorCode == 23000);
  4. I am not changing name by hand. It is automatically set to "test" and after clicking "Save" I have an error and my page disappear. Below Name field PW displays: "The name entered is already in use. If you do not modify it, the name will be made unique automatically after you save.". So I do not modify it because of this promise.
  5. Hello, Ryan once said that PW will take care of creating a name for me and it will also number-increment the name (i.e. "page-name-2") if one already exists. But when I create in admin UI a new page with name 'test' (page with that name already exists) and click "Save" button I've got an error: Session: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'test-1100' for key 'name_parent_id' TemplateFile: Unknown page My new page and its fields data is lost! It is a bug or a feature? I use PW 2.5.26.
  6. This module doesn't work with URLs with format http://www.youtube.com/watch?v=<video-id>, because oembed service doesn't recognize such URLs. I changed in module source the way of building $oembedURL: $videoID = $matches[2][$key]; $oembedURL = "http://www.youtube.com/oembed?url=" . urlencode("http://youtube.com/watch?v=" . $videoID) . "&format=json&maxwidth={$this->maxWidth}&maxheight={$this->maxHeight}";
  7. ProcessWire has builtin cache system (enabled per template basis). Why ProcessWire is not using HTTP headers Last-Modified and If-Modified-Since when cache is turned on? It seems that using this headers could increase performance and is quite easy to implement.
  8. I found that table 'field_comments_votes' (created by FieldtypeComments module) has no 'pages_id' column.
  9. Hi, I am using ProcessWire dev-2.5.24 and ProcessExportProfile 2.0.1. I have problem with exporting profile. On page "Admin > Setup > Export Site Profile" when I click button "Start Export" I get error message: ProcessExportProfile: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'pages_id' in 'where clause'.
  10. My use case is such that I have unpublished pages. I am importing URL mapping from CSV. I want that import matches old URLs with these unpublished pages ID's, because perhaps I will change name of these pages before I will publish them.
  11. I was importing from CVS. The lack of this functionality is the reason I returned to ProcessRedirects module. I don't remember text of warnings, sorry.
  12. Thanks renobird, I tried Jumplinks, but it has his own problems (import save all destinations as URLs, not page ids; it generates some php warnings etc.). I've returned to ProcessRedirects because these problems and because I need simple URL mapping. I found another problem with ProcessRedirects: it does not found hidden or unpublished destination pages. I've modified below code in order to work with hidden or unpublished pages (I've added "include=all" selector): private function _saveRedirect($from, $to, $id = 0) { $from = $this->_addUrlSlashes($from); $to = $this->sanitizer->url($to); // Not external url, if it starts with slash if(substr($to, 0, 1) == "/") { // if the redirect_to maps to a page, then store it's ID instead if(($page = $this->pages->get("$to, include=all")) && $page->id) $to = '^' . $page->id; }
  13. I seems that module dosn't work for urls (redirect-from) with UTF-8 characters. This change (adding "urldecode") in file ProcessRedirect.module fixed my problem: public function checkRedirects($event) { $url = urldecode($_SERVER['REQUEST_URI']);
  • Create New...