-
Posts
10,896 -
Joined
-
Last visited
-
Days Won
348
Everything posted by adrian
-
Have you set: $config->dbCharset = 'utf8mb4'; in config.php?
-
Done! $this->wire('bd_host', $host); results in: I decided to add the $ and keep the "bd_" prefix in the title to help better identify it as an automatically dumped wire variable. Let me know if you have any suggestions for improvements.
-
@Robin S - what do you think about this idea - I am contemplating having Tracy check $wire for any variables prefixed with "bd_" and automatically bd() them without the need to manually make a bd() or d() call. The title would be automatically set to the name of the variable after the "bd_" prefix. PS - remember you can set $wire variables like this: $this->wire('bd_host', $host); The shorter the better when adding debug statements ?
-
Really great idea @Robin S ! You can make it even less work by using d($td_host) in the Console panel:
-
How about this: <?php $p = $pages->findOne(1241); if ($p->id) : ?> <a href="<?php echo $p->url() ?>"><?php echo $p->title() ?></a> <?php endif; ?> Perhaps it's only a minor optimization, but it saves it returning any page object if the page isn't published. Be sure to read the docs on findOne() vs get() to understand fully, but basically find() and findOne() won't return unpublished pages unless to specifically request them to, but get() will ignore unpublished and hidden statuses and always return a page if everything else matches.
-
Hi @xportde - sorry about that. I have reverted those changes and taken a different approach to what I was trying to fix. FieldsetPage fields now work as expected, but there is still a problem with the individual fields under a textareas field, but I don't think that is related to the version of this module - I just don't think the Textareas module supports setting "entityEncodeText" to false, which is how this module allows html in the description. If I am correct in this assumption, then it is something Ryan will need to fix. Let me know your thoughts.
-
Using recursion to find a parent? Suggestions orther than recursion?
adrian replied to John W.'s topic in General Support
Couldn't you use this, assuming all offices, eg HUMAN RESOURCES have a template names "office" $page->parents('template=office'); Actually you might want "parent" instead of "parents" to make it easier in this case. -
Using A Child Templae As URL Variable, Without Loading the Child Page
adrian replied to John W.'s topic in General Support
@John W. - I understand the way the documents template works - to load a summary list of documents, but I still don't understand the problem with PW trying to load the individual document when the document is in the URL - how do users end up with the document component in the URL and what are they supposed to see when it is? -
Maybe I could programmatically replace mtime with modified. Can you think of any reason why mtime would actually be needed vs modified?
-
@PWaddict - I have managed to solve the problem you are seeing, but there is another issue when using $file->mtime in the rename rule for images in repeaters that I am having trouble fixing. The problem is that when you save an image, the mtime changes and there is an order problem with the mtime changing before or after the renaming of the pagefile which is causing problems. I noticed though that it all works fine if you use $file->modified instead. Would that work ok for your needs instead of mtime?
-
Ok, I think I have narrowed it down - if you don't have "overwrite" checked and you use $file->mtime it doesn't know how to name the file at the correct point it needs to. It's also necessary to have "Rename on Save" checked to have this problem. Let me see if I can fix.
-
Does it help if you use $filePage instead of $page for the rule? What about "name" instead of "title"? What about if you don't have the $file->mtime component?
-
I am testing on a multi-language site and just changed to max files 1 and it's still all working as expected. Sorry, I am not sure what else to look at right now. I am curious what Tracy's PageFiles panel reports after the initial saving of the page.
-
@PWaddict - I feel like I have replicated your described workflow and I am not seeing any problems so I will need more troubleshooting from you. Why doesn't the image display on the frontend - is the code trying to display an image with a non-existant path? What code are you using to display the image? What are the image settings - anything related to the max files or overwrite settings that are relevant? Anything you can do to narrow it down further would be very helpful.
-
Using A Child Templae As URL Variable, Without Loading the Child Page
adrian replied to John W.'s topic in General Support
So the $pages->find finds the page in the 3rd url segment and displays the content of that page? I guess I don't understand why that is better than having a template file for the document template - I am sure I am missing something, but maybe if you could better explain what you are actually trying to accomplish by doing it this way we might be able to offer some other/better alternatives. -
@Mike-it - it's due to this new bug in the core: https://github.com/processwire/processwire-issues/issues/979 Please add a comment there to get Ryan's attention about this.
-
Glad you got things working again, but I can't imagine why a base64 encoded string would cause a problem. I just tried here and it looked ok. Maybe that wasn't really the issue but somehow the exceptions.txt was corrupted in some other way?
-
Keep in mind that these two lines do exactly the same thing, so you only need one of them.
-
Note sure - would you mind finding out what contents of $logLinesData is just before line 44 of ProcesswireLogsPanel.php and also $data before and after the json_encode() on line 449 of wire/core/WireCache.php Hopefully one/both of those will help to identify the problem. Thanks!
-
You probably have "dev" in your hosts file pointing to localhost.
-
https://web.dev/native-lazy-loading/
-
All I see is this: but it's almost completely hidden until you hover over it. Anyway, as I think we all agree - this is all a PITA and I think we should interrupt the user as little as possible.
-
I don't see it at all - using Brave Browser, but thanks for pointing out that there is actually something there when it works.
-
I have also built a site on Knownhost - it's fast enough, but I did come across the nginx reverse proxy errors quite a lot - I think I managed to tweak things such that they aren't a problem now, but still found it painful initially. Also, they are just so much more expensive than Digital Ocean, so it depends on budget vs time/skills to manage the server I guess.