Jump to content

fbg13

Members
  • Posts

    344
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by fbg13

  1. @bernhard checkout VS Code, it's faster than atom (at least it was when I switched) and it's very similar to atom visually.
  2. @eelkenet Hmm, the deletion does take place before the db save and runs on ajax too. It's weird that I get no errors and the time is correct too. Changing if(!$this->localStorage) to if(!$this->localStorage && !$this->isAjax) should fix it.
  3. Did you save the page or just selected a file? If you saved the page it's normal for that one to run.
  4. @eelkenet Somehow the file gets deleted before the page is saved. Do you have any other modules installed? Did you change any of the field's default settings? I don't think my module deletes the file, there are 3 calls to the unlink() function and none should delete it under normal circumstances. You can comment them out then you know for sure, search for unlink on InputfieldFileS3.module/FieldfieldFileS3.module.
  5. @eelkenet Add it on the FieldtypeFileS3 file too on line 85, just before if($field->fileSchema & self::fileSchemaDate) { $item['modified'] = date('Y-m-d H:i:s', $pagefile->modified); $item['created'] = date('Y-m-d H:i:s', $pagefile->created); } Also replace the file_exists check with $pagefile->modified on the InputfieldFileS3.module file. I'll try to find another way to handle this.
  6. The file should be there though, as it is only removed when the page is saved. I have no idea why it's deleted. Edit InputfieldFileS3.module file (line 83) and add if(file_exists($pagefile->filename)){ $this->wire("log")->error("file exists"); } after if(!$this->localStorage) { $this->uploadFileToS3($pagefile, $this->input->get->id); } and check the log. You can add it before too.
  7. I tried on PW 3.0.62 and 3.0.65. Did you try this? Did you get any errors when doing it this way? Also take a look at the server's error log.
  8. @eelkenet Does the normal file field work on the Amazon EC2 Linux instance? The module uploads the file to the server, then uploads it to S3. The file stays on the server until the page is saved, so I don't know why filemtime() throws that warning. Try to upload another file and while it's "loading" check to see if the file is available on the server (Amazon EC2 Linux instance). To be honest I don't know much about AWS and the module is very basic.
  9. @eelkenet I just tested it (windows 10 and ubuntu 17.04) and had no problems on php 5.6 an up. On versions < php 5.6 i got the never ending spinner but not the warning. What php version are you using?
  10. You're complicating things too much. Since you don't wanna share a site profile this is my last guess. I think when you go to food.pw/category/bakery/ you actually access an existing page bakery, which is a child of category, so there are actually no url segments.
  11. @MilenKo I'm really confused on what template you're actually working/adding code? Can you echo the template name (echo $page->template->name;) of food.pw/category/subcategory? Also echo $input->urlSegment1 and go to food.pw/category/subcategory/test, let me know what you get.
  12. @MilenKo Lets take a step back. Create a page named "test-url-segments" with home as parent and assign it a template (whichever), edit that template and enable url segments. Edit the template file for the template assigned to "test-url-segments" and echo $input->urlSegment1. Now go to domain.tld/test-url-segments/i-am-a-segment and you should see i-am-a-segment and you where you echoed $input->urlSegment1.
  13. Can't think of anything else. Don't know.
  14. But you have a page named category, which is the same as the urlsegment you want to use, don't know how PW handles that exactly. If you wanna share the code (site profile) i can take a look.
  15. So you have a category page. $segment1 = $input->urlSegment1; $segment1 = $input->urlSegment2; echo $segment1; echo $segment2; You assign both segments to the same variable $segment1, but you echo $segment1 and $segment2. Since you have a page with the name "category" i assume you are on that page. In this case your first segment is not a segment but a page and your 2nd segment is actually your first. So $segment1 points to $input->urlSegment2, which doesn't exist, and $segment2 is not defined/null/empty.
  16. To what template/template file are you adding the code? Do you have a page with the name "category"?
  17. Do it outside the if statement and without sanitizing them.
  18. @MilenKo Just echo the segment and see if it has any value.
  19. @Troost Use print_r or var_dump to check $page->children and $child->head_image (before the if statement). Also enable debug if it's not?
  20. Use wire("page") instead of $page in functions. $tpl_name = wire("page")->children->first()->template->name $selector = "template={$tpl_name}";
  21. @Piqsel you're missing "template=" in your selector.
  22. Is that path correct? If you have only one includes directory change require_once("./includes/functions.inc.php"); to require_once("./functions.inc.php");
  23. Try // template name of $page's first child $page->children->first()->template->name;
  24. When echoing a date field directly from the $user variable echo $user->date; the timestamp is printed. Using echo $users->get($user->id)->date; prints the correct formated value. Is this a bug or or intended?
×
×
  • Create New...