Jump to content

tigerchops

Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Everything posted by tigerchops

  1. Unfortunately it seems that even with that swap, it still returns an empty string. I've altered the code to read as follows: if($beautify) { $iconvValue = iconv("UTF-8", "ASCII//TRANSLIT//IGNORE", $value); if($iconvValue!="") { $value = $iconvValue; } } So now it is working well as far as I can tell! Ryan, thankyou so much for your persistence and helpfulness. Silly things like this aside, Processwire is fast becoming my go-to CMS for all kinds of different sites, it's genuinely awesome. Hopefully next time I'm posting on the forums I'll be contributing!
  2. We must be getting closer! If I comment out the if statement in Sanitizer ie: /*if($beautify) { $value = iconv("UTF-8", "ASCII//TRANSLIT//IGNORE", $value); }*/ Then the page is created fine... If I do: if($beautify) { $value = iconv("UTF-8", "ASCII//TRANSLIT//IGNORE", $value); var_dump($value);die(); } I see: string(0) ""
  3. Yes, I was placing it after the name should have been set. Using the line you suggest i see: int(0)
  4. Good call, wish I'd thought more about that earlier, and identified where the issue is happening. This is what I found: In ProcessPagePart.module, in the method processInput: $nameField = $form->children->get('name'); $name = $nameField->value; if(!strlen("$name")) { $this->error("Missing required field 'name'"); return false; } $templatesId = (int) $form->children->get('template')->value; $template = $this->templates->get($templatesId); $this->page = new Page($template); $this->page->parent = $this->parent; $this->page->name = $name; $this->page->sort = $this->parent->numChildren; If I pop in a: die($name); The correct string is returned; However, if I use: die($this->page->name); nothing is returned. If I use print_r instead of die, it prints out 0. So it looks like this is where it's having problems. I am more than happy to give you access if you want to have a look about? Or do you know what is causing it now?
  5. Unfortunately neither seemed to help: I have repaired all the tables, and replaced wire with a fresh download. My Field Names are as follows: body buy_button date documents extracts headline image images media process quote reviews sidebar slideshow summary synopsis time title And my Template names: admin blog book books event event_parent home page post search sitemap I will pm you now with a link to my phpinfo!
  6. Thanks for getting back so quickly! I doubt it is a browser issue, it occurs with Firefox and Chrome, and with debugging on it shows the $_POST array to contain the right string being passed as the name variable. It's processwire 2.0.0, must have downloaded it a few weeks ago? Yes, it wasn't doing it from the start (and I have not encountered it with other installs) - I've been racking my brains to think what I could have done! I haven't installed any modules, I haven't mucked about with any files other than my template files. I am fairly sure it must be an issue with the server, one, as it seems like it can't be much else, and two because I've had issues with it in the past. I know that it will be difficult for you to help with this but maybe you can point me to the right area. Basically anything that needs permissions to run system commands like mkdir, chmod etc have always been tricky to get working. It's not a question of file permissions as they are all set correctly - basically we always have to run a script called phpcgi and for some reason that helps. So anyway, I was having problems initially with creating new pages etc as it didn't have the ability to create the folders for their assets. This was fixed by running the above script. I suspect that this issue showed up sometime after that. Hopefully you can help, but I understand if not! From my earlier poking about I know that it passes the name variable correctly to ProcessPageAdd.module so presumably something goes awry when it calls the save method: $this->pages->save($this->page); Thanks again.
  7. Bit of a weird one. I've got an install of processwire that has developed an interesting (read: infuriating!) issue. So, this wasn't always the case, but now when you create new pages, they are given a URL name of 0. The jquery is succesfully filling in the field on the Add a Page screen, and the name value is definately being passed on to ProcessPageAdd ( I echoed it out to make sure ) but somewhere beyond that it is being changed to the number 0. (Ok so technically speaking 0 is not a number but whatever ) Obviously this is causing issues as now if you create another page on the same level under the same parent page, it throws the following error: "TemplateFile: Duplicate entry '0-5766' for key 2 INSERT INTO pages SET parent_id=5766, templates_id=40, name='0', modified_users_id=2, status=2049, sort=3,modified=NOW(), created=NOW(), created_users_id=2" The interesting thing is that if you go back to edit the previously created page with URL name 0, and change the URL name to something more suitable, when you save it it now gives it a URL name of it's page ID. Only if you go back and edit a second time will it keep whatever string you give it as a URL name. Yeah.... what? So, to illustrate what is happening with an example: Lets say I create a child page of my page called Blog. I call it "Test Post". As I type this in, the field below (URL name) is automatically filled with the slug: "test-post". However when I save the page, and check under the settings, I see that the URL name is given as 0. So, I manually change it to "test-post" and press save. I look again and it is "5567" - the page id. So I change it once more and this time it sticks. Any thoughts? Where should I be looking for the problem?
×
×
  • Create New...