Jump to content

rick

Members
  • Posts

    628
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by rick

  1. Hello @umesh and welcome to the forum. There are a few topics covering remote storage or assets/files here, here, and here. The latter discussing a module. Hope this helps.
  2. The config->paths->root also contains the current process as part of the path. For example, if you are currently within a custom process module named 'widget', then the returned path is '/path/to/docroot/widget/'. You could use a combination of string functions with DOCUMENT_ROOT, CONTEXT_DOCUMENT_ROOT, and SCRIPT_FILENAME values to validate the directory. As far as I know, the script_filename value is not vulnerable so should provide a base from which to test and extract the doc root with some confidence.
  3. Hi @August, The way I limit pages to users is setting the $page->created_user_id to the $user->id. Then my selector to retrieve pages is based on the created user id matching the currently logged in user. Hope this helps. Just thinkin' out loud.
  4. Wow! Thank you! I was hoping for a suggestion where to look, not a complete working example. That is the cool thing about you, @Robin S, you are always above and beyond anyone's request for assistance. Much respect!
  5. Ok, apparently the term 'PATH" means the complete filespec (path + file). I still cannot get the allowedPath parameter to accept any entry. It always uses /site/template. I did however get this to work by providing the filespec as the first parameter. So from my first example, $file = "somefile.php"; $path = $this->wire('config')->urls('siteModules')."myModule/includes/"; $filespec = $path . $file; $result = wireRenderFile($filespec); return $result; works just fine, so I will mark this topic as solved. Can anyone reproduce this behavior? Just checking to see if this is a bug or my stupidity. 🙂
  6. The error is thrown from the wire/core/TemplateFile.php:171'/site/templates/somefile.php'. line 170 public function setFilename($filename) { bd($filename); // Shows invalid /site/templates/somefile.php if(empty($filename)) return false; if(is_file($filename)) { $this->filename = $filename; return true; } else { $error = "Filename doesn't exist: $filename"; if($this->throwExceptions) throw new WireException($error); $this->error($error); $this->filename = $filename; // in case it will exist when render() is called return false; } }
  7. I thought so as well. I tried with both urls and paths. I get the same error stating templates but tracy shows the path is correct.
  8. Howdy! I've been exploring using the wireRenderFile() function in a test module. I keep getting one error or another depending on how I attempt to render the file. According to the api doc one of the default paths is /site/modules/. In this directory I have my module, which has a sub directory for files to be rendered as needed. $file = "somefile.php"; $path = $this->wire('config')->urls('siteModules')."myModule/includes/"; $result = wireRenderFile($file, array(), array('allowedPaths' => "$path")); return $result; // Error: Filename doesn't exist: ***/site/templates/somefile.php It appears that wireRenderFile is not accepting the allowedPaths option. Tracy dump shows $path = ***/site/modules/myModule/includes/'. Any ideas on what I am overlooking? See last posting.
  9. Hello @valquireand welcome to the forums! It sounds like you are looking for an event calendar. You can take a look here at a pro module, or search for other event calendar topics. If you prefer a simpler solution, then you can create a page for each concert to display on the front-end.
  10. Thank you @adrian, I did not see that. I appreciate you locating that topic. I have it saved for future reference. In the meantime I came up with a workaround where I don't have to modify a user's ready.php file during install.
  11. This is still an issue. I cannot select a user from an auto complete select on an admin form. Even with the hooks @adrian and @bernhardsuggested in this reported issue. My select field is configured as follows: Page field value type = single/false (other options make no difference). Allow unpublished pages = checked. Type: Page auto complete. Template = User. Selector string = template=user, include=all, check_access=0, sort=name. Label field = name. When attempting to edit a page with this field this is the resulting selector: template=user, sort=title, templates_id=3, title%=sca, limit=50 *Notice the duplicate template reference. This obviously is a core issue. The resulting query is: SELECT SQL_CALC_FOUND_ROWS pages.id,pages.parent_id,pages.templates_id FROM `pages` JOIN field_title AS field_title ON field_title.pages_id=pages.id AND (((field_title.data LIKE '%sca%' ) )) LEFT JOIN field_title AS _sort_title ON _sort_title.pages_id=pages.id WHERE (pages.templates_id=3) AND (pages.templates_id=3) GROUP BY pages.id ORDER BY _sort_title.data LIMIT 0,50 Two issues with this query; 1) there are no user names present in the field_title.data column, 2) the join statement has three levels of parens, which are obviously leftover from from whatever concatenation function that was previously performed. This again is a core issue. All of my projects rely on selecting a user at various steps. Can anyone provide a workaround, or tell me what I have done wrong? I appreciate your input.
  12. Is this for the front-end? If yes, You can write your own login routine that will check against the user data (additional field denoting selected client). Once verified, redirect to the desired page. Since you don't want users to register themselves, you can add a link to your login page (similar to contact us) where potential clients can request an account. The request is emailed to the admin for processing. Just a thought.
  13. Just tossin' more info in the thread... https://github.com/salsify/jsonstreamingparser https://www.jsonfeed.org/version/1.1/
  14. Hi @Zeka, Thanks for the help. I can check whether the page is present or not. The issue is imho one of consistency. Let me elaborate... Only the 'file' field types have this 'gotcha'. For example, in PHP the procedure is as follows: Create a form User completes the form and submits (including any uploaded files) Data is then sanitized, uploaded tmp files are moved, and data written to the database or The user cancels the operation Data and form are destroyed The PW way: Create and save some dummy page Create a form User completes the form and submits (including any upload files) Data is then saved and files are moved to that page asset or The user cancels the operation (No cancel function, so navigate away) Data and form are destroyed *Page is now orphaned* You get the notice that a page with that name already exists when attempting to create another page. Interesting is that page doesn't have a title field (which is required). Using any other field type, I can perform the following procedure within my process module: Create a form User completes the form and submits Page is saved with user data and user is redirected to previous page The steps are: 1) Create blank new Page. 2) Assign Parent. 3) Assign Template. 4) Build form from Page->getInputFields() or User cancels operation Data and form are discarded and user is redirected to previous page The problem is pre-defining a page just so an empty input field has a reference before any data is provided. This only occurs when there are 'file' fields present in the template.
  15. Howdy y'all, I have created a set of fields via the api, added them to a fieldgroup, then assigned that fieldgroup to a template. One field is FieldtypeImage. When I attempt to create a form using $page->getInputFields() the following error is displayed, New page '//' must be saved before files can be accessed from it This only happens when fields relating to files are present. All the other field types are created correctly on a form. How can I 'bypass' this 'must be saved' issue?
  16. Howdy @Stefanowitsch, Have a look at this topic. Maybe it will help.
  17. Hi @gebeer, Great point. I read those two articles back when they were published, but hadn't delved further because I haven't seen any forum posts regarding its use. I basically forgot about these two articles, so thank you for bring up the subject again. I may have a couple of cases where page class would be beneficial to my projects. That being said, I would be interested in seeing an example of your implementation of page classes as modules since I am more of a visual learner, if that is at all possible. I've stuck with using modules simply because what I believe is ease of installation. I can distribute a module without manually adding to, or changing a user's directory structure as it is implied in Ryan's article. I'm curious how page classes could be included in a process and/or module distribution and installation. I hope I made some sense as I am still a bit confused.
  18. That is an issue with your script. A form can only be 'submitted' by the user manually clicking the link, or by a script performing that action.
  19. I know what you are looking for. Unfortunately, there isn't any. However, there is another alternative search that might help. For example: site:processwire.com/talk your-query-here You can substitute "blog" for "talk" (talk == this forum) and get a listing of articles covering your specific query, which is the closest thing to the type of documentation you are accustomed to. I see by your post count you have been here a while, so you know how helpful all the members are when you have a question. That is one of the best things about ProcessWire; This community.
  20. You can use the query feature of Tracy (ProcessWire Info Panel) to search various categories, such as github... https://github.com/processwire/processwire/search?utf8=✓&q=PageTable
  21. Has anyone run into the actions set for MarkupAdminDataTable not being shown? // Example code: $table =$this->wire('modules')->get('MarkupAdminDataTable'); $table->setEncodeEntities(false); $table->setSortable(true); $table->action = array('Home' => './'); $table->headerRow(['Name', something']);// yes, i use two array syntaxes for testing $table->row( array( "Red Skelton", "some data" ) ); $table->render(); // End Example code // MarkupAdminDataTable.module // line 229: public function action(array $action) { foreach($action as $label => $url) { $this->actions[$label] = $url; } return $this; } // And line 317: if(count($this->actions)) { $out .= "\n<p>"; foreach($this->actions as $label => $url) { /** @var InputfieldButton $button */ $button = $this->modules->get("InputfieldButton"); $button->href = $url; $button->value = $label; $out .= $button->render(); } $out .= "\n</p>"; } return $out; The table is displayed correctly, minus the action. There is no dom reference in dev tools for the action -- as if it was ignored. Tracy (bd($table);) shows the action as defined. What am I overlooking?
  22. Kind of embarrassed to mention my setup as it is all old school style stuff. local and remote LAMP stack SSH + RSYNC for bidirectional comms No composer, etc. Live server is with Ethernet Servers Ltd. Great VPSs. Great support too And the only module installed is Tracy VSCodium (VSCode without M$ nose buttin' in) Front end is plain html/css/js.
×
×
  • Create New...