-
Posts
344 -
Joined
-
Last visited
-
Days Won
1
Everything posted by fbg13
-
@bernhard checkout VS Code, it's faster than atom (at least it was when I switched) and it's very similar to atom visually.
-
@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.
-
Did you save the page or just selected a file? If you saved the page it's normal for that one to run.
-
@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.
-
@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.
-
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.
-
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.
-
@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.
-
Installation stops after database information page
fbg13 replied to devlisa's topic in Getting Started
Check the error logs of xampp, not pw. -
@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?
-
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.
- 28 replies
-
- urlsegment
- filter
-
(and 1 more)
Tagged with:
-
@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.
- 28 replies
-
- urlsegment
- filter
-
(and 1 more)
Tagged with:
-
@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.
- 28 replies
-
- 2
-
- urlsegment
- filter
-
(and 1 more)
Tagged with:
-
Can't think of anything else. Don't know.
- 28 replies
-
- urlsegment
- filter
-
(and 1 more)
Tagged with:
-
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.
- 28 replies
-
- 1
-
- urlsegment
- filter
-
(and 1 more)
Tagged with:
-
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.
- 28 replies
-
- 1
-
- urlsegment
- filter
-
(and 1 more)
Tagged with:
-
To what template/template file are you adding the code? Do you have a page with the name "category"?
- 28 replies
-
- urlsegment
- filter
-
(and 1 more)
Tagged with:
-
Do it outside the if statement and without sanitizing them.
- 28 replies
-
- 1
-
- urlsegment
- filter
-
(and 1 more)
Tagged with:
-
@MilenKo Just echo the segment and see if it has any value.
- 28 replies
-
- 1
-
- urlsegment
- filter
-
(and 1 more)
Tagged with:
-
[SOLVED] Images only appear when logged in as admin
fbg13 replied to Troost's topic in General Support
@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? -
Use wire("page") instead of $page in functions. $tpl_name = wire("page")->children->first()->template->name $selector = "template={$tpl_name}";
-
@Piqsel you're missing "template=" in your selector.
-
Is that path correct? If you have only one includes directory change require_once("./includes/functions.inc.php"); to require_once("./functions.inc.php");
-
Try // template name of $page's first child $page->children->first()->template->name;