Jump to content

BrendonKoz

Members
  • Posts

    232
  • Joined

  • Last visited

  • Days Won

    3

BrendonKoz last won the day on December 14 2023

BrendonKoz had the most liked content!

About BrendonKoz

  • Birthday 12/12/1980

Profile Information

  • Gender
    Male
  • Location
    Saratoga Springs, NY, USA

Recent Profile Visitors

4,128 profile views

BrendonKoz's Achievements

Sr. Member

Sr. Member (5/6)

221

Reputation

  1. Thanks - that did it! Looks like forcing "isLocal" was what I needed here. In this case it's not a guest, though I'm guessing the permission level is equivalent to guest. (I haven't explicitly added any tracy related permissions to roles.)
  2. I had thought I had Tracy enabled for all users (excluding guests) awhile back and disabled it. Now I can't seem to re-enable it now that I need to diagnose some things. I am not restricting non-superusers (or superusers for that matter), the Tracy Debugger is enabled, and I even tried to match the IP address using PCRE pattern of /.*/ with no luck.
  3. I'm responding with no experience using custom page classes, so if my reply is just silly, I apologize. 😁 Perhaps I'm missing something, but I think my question here is also the question that ProcessWire is throwing an error about. Where do your ProcesswireTemplate::INDIVIDUAL_CAR_CHOICES and ProcesswireTemplate::INDIVIDUAL_CAR_CHOICE variables' values come from? In fact, where is the ProcessWireTemplate class located? There's a Template class in wire/core, but I'm not seeing a Processwire* class anywhere. If those classes/values don't exist, that could cause the errors to be thrown. If you're moving the code to another class, maybe it's not actually being called/used and ProcessWire is falling back to using the standard Page class?
  4. This is really neat. If the action relates to a topic, can the topic name be linked to the actual topic? (I saw people viewing topics that I hadn't read in a long time and recall it being interesting; currently have to go back to the forum and search for it). Related to PWGeeks - is the "last updated" status the last time the related project was (determined to be) updated, or the last time PWGeeks checked the project's status? I ask because the very last page (279 as of right now) shows a last update time based on my current clock time. Ordering by "Recently Modified" shows FieldtypeFolderOptions on the first paginated page, but was last updated (Github) 4 years ago. I love the PWGeeks project, btw. ❤️
  5. So far my solution to this seems unnecessarily complex. I have a primary RepeaterMatrix field (`content_body`). I've duplicated that field and called it "content_column". I created a Repeater (standard) field, added a simple number field (for column width, for now) and the "content_column" field. I've added "content_row" to "content_body" as a new item. I'm using field-based file rendering, so I have a file structure such as: fields: - content_body.php - content_body/field1.php - content_body/field2.php ...etc... So now I've got to duplicate the files for rendering the contents of the "content_column" RepeaterMatrix, which is basically just a copy/paste of all the individual fields of the "content_body" folder, and maintain changes between the duplicated files. I tried to add "content_body" to "content_row" as a subfield, but I kept getting 503 errors in the admin and ultimately had to revert the database to recover. 😞
  6. My difficulties were in understanding how to set up the fields to allow such a scenario, but not make it ridiculously complicated to maintain, or for the editing end-users. I suppose offering a numerical value for the column size (ex: 2-10) per matrix item would also be a valid solution, and far more customizable. As silly as it sounds, the reason I was thinking of offering varied custom sizes is because some of our users are extremely tech-averse, and will mess that up. 😄
  7. I have a single RepeaterMatrix field that I'm using to generate a bunch of available components. Most of the remaining components left to create are intended for columnar-layout options...in this case, equal width 2-column, 3-column, and 4-column options, as well as a 30/70, and 70/30 split. Ultimately I'd prefer to offer just the column option, and leave the content of the columns up to the end-user, rather than locking it into a "1 image, 1 textarea" style option. I'm having a hard time coming up with a way to offer the dynamic option, while also limiting the column count, and am curious how others might've tried solving this issue. It can't be all that unique! EDIT: Looks like I might (manually) recreate my RepeaterMatrix field and add it into a FieldsetOpen field along with a few settings (fields), such as a min/max number (2-4) and base the layout on that for the frontend. I don't need to force the columns to match the numbers of the column setting, the components would just flow into the number of columns as needed. Definitely not the most efficient, I'm sure, but it should work. It's too bad (at least without RockMigrations) that I can't easily create a duplicate of a RepeaterMatrix field! 😅
  8. Verified: It was our webhost's (Dreamhost) customized, and overly intrusive mod_security settings.
  9. @lpa Reading over the ProcessWire Weekly, apparently there was definitely an issue that was fixed in the recent dev version. https://weekly.pw/issue/514/#latest-core-updates
  10. Just a passing thought without testing or checking, but it looks like banner_file and video_file are string-based values, whereas is_html5 and html are boolean-based (true/false). If that's correct, it's possible that some stricter checking needed to be done for PHP 8.x compatibility, and you might need to break that selector up into multiple parts.
  11. It seems as though ProcessPageAdd::getAllowedTemplates is called so many times that it doesn't actually always have a $parent value on each call (because of how my authentication is configured). I had to test for null on that value, and exit gracefully if null, and if not then I could enter into my logic. The manual assignment of values worked because it forced a value each time regardless of what was passed into the method as a $parent value for the $event object. EDIT: This now works for a superuser account, but not for a standard account. It seems there's something else in permissions that I'm missing. Updated hook method, without any added business logic of my own, is now: public function allowTemplates($event) { // Not all calls pass in an argument value if (is_null($event->arguments('parent'))) return; // Identify the intended parent template and fetch its allowed (template) children $parent_t = $this->wire->templates->get($event->arguments('parent')->template); $child_t = $parent_t->childTemplates; // Assign the allowed children to an array we can set to return $allowed_templates = []; $allowed_templates[$parent_t->id] = $parent_t; foreach ($child_t as $t) { $t = $this->wire->templates->get($t); $allowed_templates[$t->id] = $t; } // I like sorted values ^_^ ksort($allowed_templates); // Return the expected template array back to the calling process $event->return = $allowed_templates; } If I give "Edit Pages", and "Create Page" permission to the role for the child template, and "Add Children" permission to the parent template for the role, then I can create a Job Listing (child) under the Job List (parent). However, once I do that, everyone with the role can successfully do this, despite me trying to send FALSE (or some similar value) back through any available hooked method. I can't seem to override a strict parent/child relationship.
  12. Not entirely - we haven't yet identified what on our webhost (Dreamhost) caused the file to become corrupted and only upload a portion of the file. What we do know, however, is that it's not a fault of ProcessWire. 🙂 Because it's only occurred on one PDF for all the files we upload/share, it's entirely possible there was also some issue with the file itself. I'm going to wait to follow up with our host if/when we discover another file that shows this symptom. I appreciate the follow-up. 🙂
  13. Backstory: I'm working on expanding access to permissions via a specific role, by using a FieldTypeTags on both user accounts and pages alike, thereby giving me (and others) the ability to control access per-page. The logic therein hasn't been fully fleshed out, but I keep getting stuck; for instance: on the Page List (admin home) screen, the "Add" button on hover shows up, but clicking on it threw an error that I didn't have permission (it was a parent-child relationship that the child was only allowed on that parent, and there's only ever allowed to be one parent). The role doesn't have page-create (or page-add) permission because the only template that is currently access-controlled is the home template...so theoretically, all templates can be created (I'd think?). I was having trouble where template permissions were seemingly overriding my hooks that were supposed to deny access, so I removed all but "home" role permissions. Anyhow... After finding Robin's TemplatesChildPages module it let me find a hook that I could use to forcibly override template permissions (saving/publishing does work). Unfortunately, I've only been able to get the "Add New" form to render when I've created the array in the ProcessPageAdd::getAllowedTemplates (after) hook when I create the return value's (template) array manually. (In this case it's a "job-list" parent template [indexes employment offerings], and 'job-listing' child template that describes the employment position.) So the following code allows the form to render and work as expected: $this->addHookAfter('ProcessPageAdd::getAllowedTemplates', $this, 'allowTemplates'); // ... public function allowTemplates($event) { $p = $this->wire->templates->get('job-list'); $t = $this->wire->templates->get('job-listing'); $event->return = [ $p->id => $p, $t->id => $t ]; ksort($event->return); } Obviously that will only work for my explicit example above while I test adding that particular template. So I went back and adjusted the hook to make it dynamic. Unfortunately, the following code throws an exception. public function allowTemplates($event) { $parent_t = $this->wire->templates->get($event->arguments('parent')->template); $child_t = $parent_t->childTemplates; $allowed_templates = []; $allowed_templates[$parent_t->id] = $parent_t; foreach ($child_t as $t) { $t = $this->wire->templates->get($t); $allowed_templates[$t->id] = $t; } ksort($allowed_templates); $event->return = $allowed_templates; } I've taken the $event_return value and processed it through a good old fashioned echo '<pre>'; var_dump($event->return); die('</pre>'); then taken the output (copy/paste) and saved it to a file, for each version above. I used WinMerge (to quickly compare) and the files are identical. The exception that is thrown, for the dynamic version, reads: ProcessWire: ProcessPageAdd: Template &quot;job-listing&quot; is not allowed here. But, as far as I can tell, the parent and child values exist in $event->return after my hook is run in both examples...yet only one seems to be working. Does anyone have any possible thoughts on this??
  14. Looks like @Robin S had similar thoughts. 😉 https://processwire.com/modules/verify-links/
×
×
  • Create New...