Jump to content

rick

Members
  • Posts

    635
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by rick

  1. Howdy @AndySh, You purchased the pro version so you will need to post your request in that private support forum. If you do not have access, then please send Ryan a PM and he will give you access.
  2. Looks good! One item: The blog menu shows, Security & Privacy rather than Security & Privacy.
  3. Hi @arjen, Thanks for the reply. I have changed the code to match $this->wire() for fields, fieldgroups, and templates, and I am still getting the same results. [edit] Robin posted before I finished entering this reply. @Robin S, Thanks for the test. Yes I have to remove the orphaned fields manually when the uninstall fails to do so. I changed the uninstall to your code source and everything is correctly removed. I also left the field name and template name case unchanged for this test, but I'll change everything to lower-case to match the existing naming convention in the database. Even though the Add New Field option allows upper- and lower-case, and template names match the case of the php template file or whatever you enter for template names without a file. The only thing I can think of as to why it works now and not before is some typo present in my naming that isn't showing up in phpstorm. I agree with the lack of documentation too. I've spent three days writing this module and troubleshooting this install/uninstall oddity. I have copied so many forum topic links into module comments for my reference that it should be a book! Thanks for y'alls help. I appreciate it.
  4. Hi @szabesz, I have dissected many modules, and used the method described in the related post to gather the properties, which is how I came to create the example. The problem is that the one api-created template functions correctly while the other (with the exact same code) does not. There is something wrong, different, out of order, or whatnot, that I am missing. Of course starring at the problem for hours narrows my tunnel vision even more. I need another pair of eyes, and more time during the day. Where does that line form? haha
  5. I have a problem that is making my hair even more gray. I am writing a process module which constructs seven fields and two templates as shown in this excerpt: /** *** Process Module Install *** * * The following seven fields are created successfully. * No other field attribute nor context is yet defined. * */ public function ___install() { if( !$this->fields->get('field1') ) { $f = new Field(); $f->name = 'field1'; $f->type = $this->modules->get('FieldtypePageTitle'); $f->label = __('Title', __CLASS__); $f->description = __('Description.', __CLASS__); $f->save(); } if( !$this->fields->get('field2') ) { $f = new Field(); $f->name = 'field2'; $f->type = $this->modules->get('FieldtypeText'); $f->label = __('Text', __CLASS__); $f->description = __('Description.', __CLASS__); $f->save(); } if( !$this->fields->get('field3') ) { $f = new Field(); $f->name = 'field3'; $f->type = $this->modules->get("FieldtypeTextarea"); $f->label = __('Text', __CLASS__); $f->description = __('Description.', __CLASS__); $f->save(); } if( !$this->fields->get('field4') ) { $f = new Field(); $f->name = 'field4'; $f->type = $this->modules->get("FieldtypeImage"); $f->label = __('Image', __CLASS__); $f->description = __('Description.', __CLASS__); $f->save(); } if( !$this->fields->get('field5') ) { $f = new Field(); $f->name = 'field5'; $f->type = $this->modules->get('FieldtypePageTitle'); $f->label = __('Title', __CLASS__); $f->description = __('Description.', __CLASS__); $f->save(); } if( !$this->fields->get('field6') ) { $f = new Field(); $f->name = 'field6'; $f->type = $this->modules->get("FieldtypeTextarea"); $f->label = __('Text', __CLASS__); $f->description = __('Description.', __CLASS__); $f->save(); } if( !$this->fields->get('field7') ) { $f = new Field(); $f->name = 'field7'; $f->type = $this->modules->get("FieldtypeImage"); $f->label = __('Image', __CLASS__); $f->description = __('Description.', __CLASS__); $f->save(); } /** * Template1 name displays correctly in Setup > Templates. * Template1 shows three assigned fields. * Template1 shows assigned fieldgroup. */ if( !$this->templates->get('Template1') ) { $fg = new Fieldgroup(); $fg->name = 'Template1'; $fg->add( $this->fields->get('field1') ); $fg->add( $this->fields->get('field2') ); $fg->add( $this->fields->get('field3') ); $fg->save(); $t = new Template(); $t->name = 'Template1'; $t->fieldgroup = $fg; $t->save(); } /** * Template2 name displays correctly in Setup > Templates. * Template2 shows zero (0) assigned fields. * Template2 shows assigned fieldgroup. */ if( !$this->templates->get('Template2') ) { $fg = new Fieldgroup(); $fg->name = 'Template2'; $fg->add( $this->fields->get('field4') ); $fg->add( $this->fields->get('field5') ); $fg->add( $this->fields->get('field6') ); $fg->add( $this->fields->get('field7') ); $fg->save(); $t = new Template(); $t->name = 'Template2'; $t->fieldgroup = $fg; $t->save(); } } /** *** Process Module Uninstall *** * */ public function ___uninstall() { $t = $this->templates->get('Template1'); if( $t ) { $this->templates->delete( $t ); } $fa = array( 'field1', 'field2', 'field3', 'field4', ); $fg = $this->fieldgroups->get('Template1'); if( $fg ) { // also tried with, $fg->count > 0, ... foreach( $fa as $f ){ // ...and, $fg->items as $f, without $fa array $df = $this->fields->get( $f ); $fg->remove( $df ); $fg->save(); wire('fields')->delete( $df ); } $this->fieldgroups->delete( $fg ); } $t = $this->templates->get('Template2'); if( $t ) { $this->templates->delete( $t ); } $fa = array( 'field5', 'field6', 'field7', ); $fg = $this->fieldgroups->get('Template2'); if( $fg ) { foreach( $fa as $f ){ $df = $this->fields->get( $f ); $fg->remove( $df ); $fg->save(); wire('fields')->delete( $df ); } $this->fieldgroups->delete( $fg ); } } The installation is partially successful in that it creates all seven fields as I have them defined and displays them in the fields list. The two templates are created and display in the templates listing. However, only the first template (Template1) has the three assigned fields listed on the basics tab. Template1 does not list any fields. The next issue is during uninstall. The templates and fieldgroups are removed, but the fields are not. There are no errors in the ProcessWire logs, dev console, tracy, or my server logs. I'm running php7.0, blank ProcessWire 3.0.62, and MySQL 5.0, apache 2.4, on localhost. Can someone offer a suggestion as to what I should be doing differently?
  6. @Dinodog, This doesn't appear to be a ProcessWire issue. However... The error is displayed from this div element located just after the closing form element: <div id="error" class="error box"> Something went wrong, please try again later. We truly apologize for the inconvenience. </div> This indicates that the javascript validation function is failing causing this div element to become visible (rather than the success message). The validation is failing for some reason, either improper user input, or a bug in the code. The form contains this hidden element which gets submitted with the other form data: <input type="hidden" name="recipients" value="developer2@puredataconsulting.com, stay@reeflodge.com.au, designer@puredataconsulting.com" /> Do you get any emails at the stay@ address? Also, the two references to pure data suggests two things. First, pure is the company that produced your web site, and two, they also get copies of all your confirmation emails (why?). Are there any error entries in your server logs which might indicate another cause? Such as the email routine? If so, please post back with that information so we might be able to help further.
  7. I've looked there before. -1 Removed? +1 [edit] Just now says it is not available for my account. Remove: +9
  8. Post your question(s), including any code you're having trouble with, and someone will be glad to help. Welcome to the forum.
  9. Howdy @bkno, and welcome to the forum. ProcessWire itself is very secure, in that there have been few, if any, security related updates. In fact, I am not aware of any such update in the couple of years I have been using ProcessWire. Consequently, there isn't a security mailing list like what you have become familiar with in other platforms. As far as an upgrade regiment is concerned, if you stick with the latest master version you should have no issues. For those times that you do wish to upgrade, the procedure is very simple and as a result, not anywhere close to being tiring as with the other cms/cmf you have worked with. And the only real reason you might upgrade is when new functionality becomes applicable to your site. The modules that you can install are created by the community, and should be treated as any user-defined content. As with any publicly accessible resource, it is up to the developer to guard against malicious intent. ProcessWire provides a number of tools to assist you, such as sanitizing data submitted by your users. That being said, the community members here are very knowledgeable and very experienced, and again, I am not aware of any security issues with the modules they produce. The previous security issues you experienced is why I also left those other environments. I have had no disappointments or regrets moving to ProcessWire. In addition, you can browse any topic in this forum and see the quick and accurate support provided by the community members. I don't intend for this to sound like a sales pitch. I'm only stating the facts as I have come to know them. There ya go. @LostKobrakai is one of those community members. He beat me to the post. Again.
  10. Howdy @Thorsten, and welcome to the forum! The only thing I can think of in my limited experience is since it is a different server maybe the rewrite in htaccess is not correct. If throwing this exception worked on a previous server, and now does not work on a new server, that leads me to believe there is something out of whack with the new server. Others more knowledgeable will be along shortly to help further. Again, welcome to the fold.
  11. Howdy y'all! I am referencing this great tutorial by @abdus regarding an orders list displayed in the admin section. One thing I would like to accomplish is having each order row expand (child rows) to display each line item of the selected order. (The image is an example of child rows from datatables jquery plug-in). I haven't found anything relating to this functionality in the admin data tables source or in the forum. Is this possible either using existing ProcessWire functionality, or do I need to include a reference to the datatables jquery plug-in in the module to achieve this effect? I would prefer to stay with internal ProcessWire functionality rather than adding dependencies. I appreciate the help!
  12. Howdy again The last quote gives you the cause of the error, destination path is not writable. <-- The permissions of your folder structure are not correct, and ProcessWire can't write to the destination. In your /site/config.php file is listed the permissions ProcessWire needs, as shown below. /** * Installer: File Permission Configuration * */ $config->chmodDir = '0755'; // permission for directories created by ProcessWire $config->chmodFile = '0644'; // permission for files created by ProcessWire I'm not sure what control panel you are using to access your document root, but most, if not all, have some mechanism to set/change permissions. In your /site/ folder, you will see a folder named, assets. Select this folder and then set the permissions for it and ALL folders and content below it. That should do it. Post back if you have any more questions.
  13. I have not seen an htaccess file with a version number on it. The install procedure should have renamed the htaccess.txt to .htaccess if your permissions were set correctly. Is your document root defined as reidsengland ? Or is the document root reid ? If the docroot is reid, and you placed the PW files in the reidsengland sub folder, then the rewritebase should be /reidsengland/. You have probably already seen this, but I'm posting it for others too. Troubleshooting
  14. Hi @eutervogel, This is a great site. Nice work! The only observation is the media query breakpoints need tweaking. As the viewport narrows, the logocontainer div, catsinner div, and videoholder div contents do not scale well. For example, at 960px. Otherwise, this is an impressive site. Well done. PS. Welcome to the forum!
  15. Hi @SamC, Yes, my /home/policy page uses the policy template. The /home/policy/privacy and /home/policy/tos pages also use the policy template from the allowed template for children setting. I just redirect /home/policy page to /home/policy/privacy page to prevent access or 404. As I said, there is probably a more ProcessWire-esque way to do it, but I don't know what that would be.
  16. If it is a new install, then the user salt (site/config.php) will be different, which affects the passwords.
  17. I am sure there are idiosyncrasies with certain hosting environments, but I have not run across anything outside what the general upgrade instructions dictate. There is also a profile export module with instructions in this thread that I found very helpful.
  18. rick

    Chrysemys nl

    Also, your figure images in the photos section aren't aligned in Opera, Chrome, and Firefox... It might seem as though we're picking on your site, but in fact, quite the opposite. I really like this site and how you put it together so I hope you don't mind the help.
  19. I was referring to google moving toward the https preference; a secure site is preferable to it's non-secure counterpart. Also, the www prefix became redundant a few years back and isn't necessary any longer. The dns record accounts for those users who still use it. You have two separate web sites with two separate domains, or is this what you were referring to with www.domain.com pointing to one site, while domain.com points to the other? Depending on your hosting provider, there are configuration files specific to a domain located somewhere. I run unbuntu on my laptop (LAMP) and debian (LAMP) on my production server. Apache is using sites-available/sites-enabled structure to hold the virtual config files. My non-secure (http) virtual config looks at requests on port 80 (non SSL) and redirects to https. This is where I was getting confused. You mention both protocols (http and https) point to the same content, but you also mention how to modify the code used for both sites. Is it two different sites serving the same content? Having separate registrars and separate hosting providers is only a management issue for you (or whomever is responsible) by having to log in to different accounts to manage the information. Purely as an option, you could eventually consolidate your domains under one registrar, and even place all the domains on one hosting account.
  20. Also, if I (user:Rick) am getting two emails, the first is my confirmation, and the second is for user:Xonox confirmation, then I either entered my own email both times, or your code is not reading the email field value with the second form submission. Are you using the current user anywhere to retrieve any information, such as the email address?
  21. Ok, on my second cup of coffee now. So the desired resulting structure is like so: /agenda/ /get-a-cup-of-coffee/ /rick /xonox $p = new Page(); $p->of(false); $p->template = 'reservation'; $p->parent = wire('pages')->get('/agenda/' . $sanitizer->text($input->post->page_target) . '/'); $p->name = microtime(); $p->title = $form['name']; $p->save();
  22. Hi @Xonox, A couple of things stand out at first glance. The naming convention is confusing to me. Specifically, the use of 'name'. For example, 'name' is a property of the input form, and any other form element, such as input fields, and it's value is what gets submitted with the form. Could the $input->post->name field be firstname, or username, or document name, or something uniquely identifying that specific field? Then there is the use of the '$form' variable. I understand what you are doing, but it is very confusing to read. This could be $inputForm, or whatever you think is more meaningful. Last thing is the 'parent' property of your new page. If the $input->post->page_target value turns out not to be valid, then the save function would fail. Why is a 'known' value being passed through input processing? Or is this a select field with only known pages as valid options? Sorry for my confusion. It's my first cup of coffee.
  23. Maybe I am missing something, which is quite possibly the case. So please educate me. There are two protocols, http and https, for a single domain, but including the extraneous www, gives four combinations. As previously mentioned, www can be defined at the Address record level (or CNAME depending on provider) at your hosting provider. This in effect allows users to type or link to www.yourdomain.com and yourdomain.com resulting in the same hosting server doc root destination. So that leaves the two protocols remaining. Are you serving content specific to a non secure site that is not available through the secure site? If there is no specific content unique to one site, then you can use https://yourdomain.com (better google results), and also set the ProcessWire templates to https only (Although that last part is optional). In my non-secure site conf file, I redirect non-secure requests to the secure site by the following: <VirtualHost x.x.x.x:80> ServerName domain.com Redirect permanent / https://domain.com/ </VirtualHost> This is my exact setup, and using the ProcessWire generated htaccess file. Google's page speed reports, "In our test, your server responded in 0.28 seconds." There were no re-direct incidents, and visitors can access my secure site using any of the four combinations. Like I said, if I am missing something, then please let me know. I'm always open to learning something new.
×
×
  • Create New...