monchu

Members
  • Content count

    41
  • Joined

  • Last visited

Community Reputation

15 Good

About monchu

  • Rank
    Distinguished Member

Profile Information

  • Gender
    Not Telling
  • Location
    Melbourne

Recent Profile Visitors

1,437 profile views
  1. Try to clean compiled files and refresh first if still got the error try to uninstall any 3rd party modules
  2. I still prefer the Page Reference because the flexibility to get more values from the page itself
  3. On each process page I usually added an option field for i.e named it as 'toggles' to restrict user's view access. So in wire('pages')->find('template=your_template, toggles=your_user_roles'), you can restrict the user's access. At the moment I'm developing the process for thousands of property addresses and contractors, the queries are quite fast. It always relies on how you design the process itself. In term of security, at least until today pw doesn't have any security issue. As long as you're sure to manage your front-end script carefully I think pw core is really good in the security part.
  4. I'm using pw for a web app as well. I'm not PHP expert just a self-taught programmer learn from copy and paste What I did wrong for the first dev with pw I was not using pencil and paper to design the process first ... So just for sharing to your question: Page in PW is not just a content; I use PW front-end as a database form to process certain action. Each process will refer to the user's role Create the template to accommodate that process and setup user's access right for each template. No need to create a file template if it's not a content template. Finally, configure the access right on the field level. But be careful here, to write down in detail in your documentation, or just use hook for that purpose.
  5. I'm not sure LostKobrakai, in my case, once I deleted that line then I'm able to add a field. the error gone.
  6. If you're using site-regular during pw installation, you have to remove this $config->dbEngine = 'InnoDB'; from config.php
  7. You can just add a 'None' option as a selection for user to tick nothing and manipulate it in your code
  8. You don't have to hide it. In your Google Console Panel just add the domain name URL with wild card or only certain url addresses for that API.
  9. Hi, to upgrade or downgrade what I always do is to rename the existing wire folder then copy a new wire folder. In general thats the only thing you need to do for pw upgrade. Once you're happy with the upgrade then you can remove the old wire folder. You only have to replace .htaccess and index.php if you upgrade from pw 2.xx to 3.xx
  10. I also found the same problem for adding FieldtypeOptions through API. Below are the codes that I'm using which is work well for other field types. From the json export the FieldtypeOptions array value is in this line "export_options": {"default": "1=on|On\n2=off|Off\n3=indexon|Index On\n4=indexoff|Index Off"} public function extraFields() { $fields = array( 'invoice_stat' => array('id'=>'112', 'type'=>'FieldtypeOptions', 'flags'=>'0', 'name'=>'invoice_stat', 'label'=>'Status', 'description'=>'', 'derefAsPage'=>'1', 'collapsed'=>'0', 'columnWidth'=>'', 'parent_id'=>'', 'template_id'=>'', 'findPagesSelector'=>'', 'labelFieldName'=>'.', 'inputfieldClass'=>'InputfieldSelect', 'usePageEdit'=>'0', 'labelFieldFormat'=>'{pg_alias}', 'tags'=>'', 'allowUnpub'=>'', 'showIf'=>'', 'required'=>'', 'requiredIf'=>'', 'findPagesCode'=>'', 'defaultValue'=>'1=on|On\n2=off|Off\n3=indexon|Index On\n4=indexoff|Index Off', 'addable'=>''), ); foreach ($fields as $field) { $f = new Field(); $f->type = $this->modules->get($field['type']); //$f->id = $field['id']; $f->name = $field['name']; $f->label = $field['label']; if (isset($field['inputfieldClass'])) $f->inputfieldClass = $field['inputfieldClass']; if (isset($field['inputfield'])) $f->inputfield = $field['inputfield']; if (isset($field['export_options'])) $f->export_options = $field['export_options']; if (isset($field['flags'])) $f->flags = $field['flags']; if (isset($field['description'])) $f->description = $field['description']; if (isset($field['notes'])) $f->notes = $field['notes']; if (isset($field['derefAsPage'])) $f->derefAsPage = $field['derefAsPage']; if (isset($field['collapsed'])) $f->collapsed = $field['collapsed']; if (isset($field['parent_id'])) $f->parent_id = $field['parent_id']; if (isset($field['labelFieldName'])) $f->labelFieldName = $field['labelFieldName']; if (isset($field['tags'])) $f->tags = $field['tags']; if (isset($field['allowUnpub'])) $f->allowUnpub = $field['allowUnpub']; if (isset($field['showIf'])) $f->showIf = $field['showIf']; if (isset($field['columnWidth'])) $f->columnWidth = $field['columnWidth']; if (isset($field['required'])) $f->required = $field['required']; if (isset($field['requiredIf'])) $f->requiredIf = $field['requiredIf']; if (isset($field['template_id'])) $f->template_id = $field['template_id']; if (isset($field['findPagesSelector'])) $f->findPagesSelector = $field['findPagesSelector']; if (isset($field['findPagesCode'])) $f->findPagesCode = $field['findPagesCode']; if (isset($field['labelFieldFormat'])) $f->labelFieldFormat = $field['labelFieldFormat']; if (isset($field['defaultValue'])) $f->defaultValue = $field['defaultValue']; if (isset($field['addable'])) $f->addable = $field['addable']; $f->save(); } }
  11. if you have a backup you can get the error file from this folder /site/assets/logs/errors.txt
  12. module

    Hi pmarki, can I use this module for pw 3.xx version?
  13. As a sample, if you open _main.php under the processwire installation => site-default folder, you can add google adsense scripts before </head> tag or at the end of that file before the closing body tag - </body>
  14. On the admin Module menu there are no Sites/Core/Configure/Refresh menu. To upgrade, I always rename first the existing wire folder then upload manually the new wire folder. While upgraded from 3.0.17 to 3.0.30 there are no errors at all.
  15. Hi All, I have upgraded from 3.0.30 to the latest one 3.0.32 then found error in the admin page. The module link is not working. Error: Class 'ProcessWire\ProcessModule' not found (line 493 of /usr/share/nginx/html/pw3/wire/core/Modules.php) I tried to remove /site/assets/cache/FileCompiler/site, it doesn't work. Is it a compiler issue or something wrong with my templates name spaces? I tested in apache server, it is working. I'm not sure yet but it might be the problem in .htaccess changes? Thanks