chcs
Members-
Posts
28 -
Joined
-
Last visited
chcs's Achievements
Jr. Member (3/6)
16
Reputation
-
I have extended this module to include public function deleteTag($email, $tag, $list = NULL) {} public function setTag($email, $tag, $list = NULL) {} public function getTags($email, $list = NULL) {} would you like to add these to your module so that it can handle tags?
-
Because of some server issues, and page loading speed and performance, I've been using Cloudflare to set up "cache everything" page rules for various sites. Cloudflare, by default, only caches assets like css or jpgs, but not the actual document html that is created by the server on request. Setting "cache everything" changes that and allows Cloudflare to serve up the html directly (rules providing). This cuts down the initial TTFB (time to first byte) considerably, especially during high traffic or server attacks. In order to tell whether Cloudflare is serving up an asset or not, you need to inspect the headers (break out your html inspectors and look at the network tab). In the response for the asset (jpg, css, document, etc) you'll see an attribute for "CF-CACHE-STATUS" and the associated value. <?php // include "../index.php"; $name = $_REQUEST["name"]; echo "<pre>"; echo "hello ?name=$name"; $number = 9; while ($number > 0) { $result = $number - 1; echo " $number - 1 = $result "; $number--; } The above is the code in a file named https://www.chas.us/test/no_pw.php With your developer tools tuned to the network tab you can load this page. you can provide it different querystrings in order to trigger Cloudflare to react and cache it, while you study the cf-cache-status flag https://www.chas.us/test/no_pw.php?name=chcs CF-CACHE-STATUS = MISS reload CF-CACHE-STATUS = HIT What does this mean? It means that you made a request, through Cloudflare, to get the page. Cloudflare realized it didn't have a copy of it, so it went to the server directly for it. When the server created the html, Cloudflare served it to you and stored it. However, on your subsequent reloads, Cloudflare will realize that it has the copy and serve it directly to you, without requiring your server to execute php to recreate it. You have effectively "HIT" the cached version. I have a second file where I merely un-comment the include line that bootstraps Processwire. I did this as the most bare-bones attempt at troubleshooting what I was seeing in a conventional Processwire site/templates driven website. With your developer tools tuned to the network tab... And following the same procedure you did above https://www.chas.us/test/pw_included.php?name=ohhello CF-CACHE-STATUS = BYPASS reload CF-CACHE-STATUS = BYPASS As you can see, I am not using any Processwire methods to output code, but when I include it when generating the page... something about it causes Cloudflare to not cache the generated page. This is a problem whether I am bootstrapping PW (like the above bare-bones example) or whether I am using it in the standard conventional way for a proper website. Cloudflare seems to always get bypassed so that the server can create the the page. I've also attempted to change the template cache value to see if that would somehow enable Cloudflare to serve the page, but it does not. Not sure how to proceed, as this finding seems to indicate that I cannot leverage the speed of Cloudflare on websites that employ Processwire to generate the html markup. Help!
-
This has been resolved. The issue was with the WHM firewall.
-
We'd like to send email from WireMailSMTP using G Suite. Google offers three different options: https://support.google.com/a/answer/176600?hl=en We've tried every variant we can, without success. For anyone using G Suite, which Google option works for you? What settings have you used in G Suite admin, and which settings have you used in the WireMailSMTP config? (We have enabled the "allow less secure apps" option, and are not using 2-factor authentication.) Your help is much appreciated.
-
We moved a processwire site from backup to a new server. When we try to load the homepage we get an internal server error. We are unable to log into the admin. Some of the site template files seem to be loaded and shown in the output but we have no ability to log into our /admin or generate any front end content that isn't an error message or 404 site/assets/logs/ exceptions.txt --- 2018-10-05 20:31:59 guest http://www.website_name_here.com/http404/ Template 'home' is used by the homepage and thus must manage access (in /wire/core/Templates.php line 146) errors.txt --- 2018-10-05 20:31:59 guest http://www.website_name_here.com/http404/ Error: Exception: Template 'home' is used by the homepage and thus must manage access (in /home/user_account_here/public_html/wire/core/Templates.php line 146)
-
module Recurme – Processwire Recurring Dates Field & Custom Calendar Module.
chcs replied to joshuag's topic in Modules/Plugins
I definitely understand the line one has to draw when making assumptions for the user, but it seems that in some instances you do make those assumptions already -- which is why those properties of the object feel really inconsistent and confusing. I think that issue is driving some of the posts in this thread that ask about those properties and why they don't seem to output what we expect. Depending on whether it's a one time event, an all day event, or a recurring event, they behave a bit differently or in unexpected ways. It's almost that I would prefer you to make a consistent assumption, but provide the tools to make an alternative output for myself. Right now it seems that the implementation relies much more heavily on simply understanding what I need to do to get the simple output that I expected to get. It's not an easy question to answer, but I hope you have an understanding of where I (and others?) see the confusion. The admin field, screens, and some of the tools you provide are very slick... but the object for custom output is harder to figure out, or simply not that useful depending on the nature of recurrence (or not). Thanks! -
module Recurme – Processwire Recurring Dates Field & Custom Calendar Module.
chcs replied to joshuag's topic in Modules/Plugins
@joshuag I did use that, I know the post was a bit verbose but it listed all the steps I took and all the problems I found using recurme in three different event/date scenarios I see, but it leads to an issue when you get to an event page. Let's say ROCKBAND is in town and they are playing 4 nights in a row. On the "events" page you see the 4 dates, and click one of them. As a user you now expect to ge to the event page to get details for the date you clicked... the question becomes how do I output "ROCKBAND, Super Arena, October 3, 2018 8pm" as that is what the user clicked on from the calendar. If it was used internally I'd expect $recurme->event($page)->date to properly output the string, but it doesn't. There is thus no elegant way to access it from the object, requiring us to check for the get string and handle it ourselves, correct? Effectively it makes the ->date property inaccurate and makes me question why I would ever rely on it and why it exists in the first place. Since the recurme object is generating the calendar, and making the link, and then hopefully getting the date data when I generate the output.. I would expect it to handle it rather than adding my own logic in. -
module Recurme – Processwire Recurring Dates Field & Custom Calendar Module.
chcs replied to joshuag's topic in Modules/Plugins
Hi @joshuag we're having some problems. Background info, we have an "event_date" recurme field on the "event" template. Simple case studies, I have three event pages. start_end - a one day event with a start and end time all_day - a one day, all day, event three_days - a recurring event that has a start/end time, repeated every day for three days in a row. oddity #1 - "data" when you land on their respective pages, <?= $page->event_date; ?> yields a json object (expected). the "dates" key in that object is populated with an array of three dates for the three_days event. however, with the other two pages where you'd maybe expect one date in the array, there's hundreds, stretching for about eight years. https://pastebin.com/1URSn6pF oddity #2 - $event->start_date as noted in the documentation, one is expected to get the event data using $event = $recurme->event($page); Now that we've acquired the recurme event object, I would expect access to the date of the event once the user is on the page of the event. start_end <?= var_dump ($event->start_date); ?> == NULL all_day <?= var_dump ($event->start_date); ?> == NULL three_days <?= var_dump ($event->start_date); ?> == int(1534968000) The first two single day events being expected to return a result considering there is only one set. The null problem extends to other properties of $event, eg: *->orig_date, *->date, *->month, etc. with the expected strings only existing in the recurring event page. working off this problem... oddity#3 - $event->start_date for recurring events Your $recurme->renderCalendar() or $recurme->renderList() methods render links for the event pages, and taks on a querystring which seems to indicate the start date of the events. However, like the above, the start_end and all_day pages, with querystrings still yield nothing when trying to extract the date conveniently from the $event object. Furthermore, with recurring event three_days is on the 22nd of august, 23rd, and 24th. Landing on the the page, with its respective querystring, yields the wrong date. for example: foo.com/events/three_days/?date=1535140800 One would arrive at the above page from clicking through from the rendered list, or rendered calendar. However, now echoing the date for the event <?= var_dump ($event->start_date); ?> you would expect to see the integer/date strings for the august 24th date, but you actually get the original from aug 22. This problem extends into all the respective strings. eg: foo.com/events/three_days/ <?= $event->date ?> == "Aug 22, 2018 @ 1:00 pm" foo.com/events/three_days/?date=1534968000 <?= $event->date ?> == "Aug 22, 2018 @ 1:00 pm" foo.com/events/three_days/?date=1535054400 <?= $event->date ?> == "Aug 22, 2018 @ 1:00 pm" foo.com/events/three_days/?date=1535140800 <?= $event->date ?> == "Aug 22, 2018 @ 1:00 pm" The first two being expected/correct. The latter two I would expect to be Aug 23 and 24 respectively considering these links were generated through the calendar. --- I'm not sure how to proceed exactly. Certainly I can jump through some hoops on my own end and grab the query string if it exists, or output arrays of dates if it doesn't, and parse json for single day events with no recurrences... but it seems like I am spending more time testing and debugging contingencies than having the field work in ways I expect it to. Is there maybe something I can do to think about this in a different way, or perhaps some sort of new version (i'm using 1.0.3 and a new dev version of PW)? Thank you! -
Setting 'autoload' => true in the module info worked. Thanks!
-
$field->template_id = $this->templates->get("mm_state")->id; That worked! Thanks
-
After running this code in my module's __install() the template_id is not set. Any ideas why? (The export contents from the template created and the one that I built with Admin are the same. Both exports have the template_id is set to mm_state. When I go to edit the field in Admin, the template is not showing on the Input tab and it doesn't show the template title on a page using the template that uses this field. Using processwire 3.0.98) // mm_state $field = $this->fields->get('mm_state'); if (!@$field->id) $field = new Field(); $field->type = $this->modules->get("FieldtypePage"); $field->name = 'mm_state'; $field->label = 'State'; $field->derefAsPage = 2; $field->inputfield = "InputfieldSelect"; $this->fields->save($field); $field->labelFieldName = 'title'; $field->template_id = 'mm_state'; $field->columnWidth = 100; $field->required = true; $this->fields->save($field);
-
It seems that the confirm field in this module get it's id based on the name attribute instead of the id attribute . So if one changes the id attribute to a value other than the name, the confirm input id is not effected. I consider this a bug. In the module that I am developing I have multiple tabs with forms in multiple tabs. This causes id duplication when using the InputfieldPassword field on two different tabs. I can get around the problem by specifying the id for the field, but in the case of the InputfieldPassword field, it bases the Confirm id attribute on the name attribute instead of the id attribute. I am using ProcessWire 3.0.98 and have attached the modified module (see lines 209 and 241) InputfieldPassword.module
- 1 reply
-
- 4
-
I put the following code into our membership module but it does not seem to redirect. Any ideas why? Thanks. public function init() { parent::init(); // set landing page $this->addHookAfter('Session::loginSuccess', null, function($event) { if (!$this->wire('user')->isSuperuser()) { $path = $this->wire('config')->urls->admin . "membership/"; $this->wire('session')->redirect($path); } }); }
-
Private module used in private repos for multiple sites?
chcs replied to chcs's topic in General Support
@kixe Thank you for responding. Perhaps we need a broader understanding of what is involved? The module we are developing is client-specific, and is not really applicable to the broader community, so registering at modules.processwire.com doesn't seem to make sense. So it seems we would need to create a private module feed to keep these modules up to date across sites? Is there documentation on that, or is there an alternative that will scrape the module code of a private repo to generate it? Your first solution regarding changing the moduleServiceUrl to this private feed, would that unhook the site from modules.processwire.com for core updates and free-use plugins? Thank you again for replying and helping us work through this.