Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

33 Excellent

About Neo

  • Rank
    Sr. Member

Recent Profile Visitors

2,577 profile views
  1. Thanks for your feedback. Job pages are created using a front end form. In order to trash the old jobs, I ended up with the following code: $jobs = wire('pages')->find("template=job-template, parent=/expired-jobs/, include=unpublished"); foreach($jobs as $job) { $job->trash(); } Now, regarding the problem of adding a unique value to each job link, I guess I would have to update Processwire first in order to access the PageNames and WireRandom classes?
  2. Hey, I have a small niche job board that is based on ProcessWire 3.0.62 and encounter 2 problems: 1. Job pages are unpublished after a certain amount of time using a cron job and then moved as children to the "Expired Jobs" page. Now, it is a bit annoying having to delete those old, unpublished job pages individually. What is the best way to programmatically delete all children of the "Expired Jobs" page in one go using a protected template in the backend? 2. I am starting to get a problem with many similar job titles. Although, Processwire will add a number to the end of a link, when a certain job title already exists (e.g. My-Job-1, My-Job-2), this causes problems from time to time with the unpublishing process, for instance Can't save page 1997: /expired-jobs/product-designer-2/: Chosen parent '/expired-jobs/' already has a page named 'product-designer-2' What would be the best way to add a unique identifier to each link (e.g. combination of 6 or more random numbers and letters) to ensure unique links despite equal job titles? Thanks for your feedback.
  3. To provide further details regarding the server configuration: httpd -v Server version: Apache/2.4.6 (CentOS) Server built: Oct 19 2017 20:39:16 ---------- php -v PHP 7.1.16 (cli) (built: Mar 28 2018 13:19:29) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.1.16, Copyright (c) 1999-2018, by Zend Technologies ---------- mysql -V mysql Ver 15.1 Distrib 5.5.56-MariaDB, for Linux (x86_64) using readline 5.1 I could post the complete php.ini if required, but will share some key values for the moment: output_buffering = 4096 max_input_time = 60 memory_limit = 128M post_max_size = 8M upload_max_filesize = 2M max_file_uploads = 20 default_socket_timeout = 60 Http and database are running: sudo netstat -plunt | grep httpd tcp6 0 0 :::80 :::* LISTEN 832/httpd tcp6 0 0 :::443 :::* LISTEN 832/httpd sudo netstat -plunt | grep mysql tcp 0 0* LISTEN 1085/mysqld Last updates have been installed in March, but this is an issue that happened before.
  4. Hi, I am running ProcessWire 3.0.62 on a 512 MB VPS with CentOS 7.3.1611 x64. The site operates stable for a couple of days and then suddenly shuts down with an internel server error - 500. I first thought this might be a caching issue and I disabled mod_pagespeed, but the problem persists. I noticed the following errors in the ProcessWire log that match this timeframe: Error: Exception: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away (in /var/www/html/wire/core/WireDatabasePDO.php line 454) Error: Exception: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away (in /var/www/html/wire/core/PagesLoader.php line 1110) Error: Exception: SQLSTATE[HY000] [2002] Connection refused (in /var/www/html/wire/core/ProcessWire.php line 377) Having a look at /var/log/httpd/error_log shows the following entries: [Mon Apr 30 03:36:02.299543 2018] [auth_digest:notice] [pid 835] AH01757: generating secret for digest authentication ... [Mon Apr 30 03:36:02.300730 2018] [lbmethod_heartbeat:notice] [pid 835] AH02282: No slotmem from mod_heartmonitor [Mon Apr 30 03:36:02.496198 2018] [mpm_prefork:notice] [pid 835] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.1.16 configured -- resuming normal operations [Mon Apr 30 03:36:02.496220 2018] [core:notice] [pid 835] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND' [Mon Apr 30 08:58:41.709509 2018] [mpm_prefork:notice] [pid 835] AH00170: caught SIGWINCH, shutting down gracefully [Mon Apr 30 11:59:04.905878 2018] [suexec:notice] [pid 832] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using ::1. Set the 'ServerName' directive globally to suppress this message [Mon Apr 30 11:59:05.452221 2018] [auth_digest:notice] [pid 832] AH01757: generating secret for digest authentication ... [Mon Apr 30 11:59:05.456054 2018] [lbmethod_heartbeat:notice] [pid 832] AH02282: No slotmem from mod_heartmonitor [Mon Apr 30 11:59:05.922452 2018] [mpm_prefork:notice] [pid 832] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.1.16 configured -- resuming normal operations [Mon Apr 30 11:59:05.922522 2018] [core:notice] [pid 832] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND' There is nothing in the log that would immediately catch my attention regarding this 500 error. If I reboot the server the site operates normally again. Would appreciate your assistance to find the problem. Thanks
  5. Can you now select and sort by publication date of a page? I am looking for something like: $pages->find("template=MyTemplate, limit=15, sort=-published"); The documentation does not seem to list "published" and only shows "created": http://cheatsheet.processwire.com/selectors/
  6. I am working on a site that needs a simple booking calendar: - Visitors can choose a date and time-slot from a calendar on the front-end. - Reservations will be listed in the back-end and have to be confirmed by the admin. - Once the reservation is confirmed, an email is sent to the visitor. Not sure if there is an existing module out there for not reinventing the wheel. Already had a look at the module section, but couldn't find anything stable so far. Would appreciate your ideas.
  7. Thanks for your responses. Yes @adrian, the idea to record and send search requests is unusual, but this will not be a high traffic site and there will be additional filters, who can access the search function. To summarize your input: 1. Search: As @Robin S mentioned, can I use a simple GET request to handle the search terms from the form and then process input in a single search template (search.php)? I.e. Get search terms -> sanitize input -> save input to variables -> create PHPMailer object and send input variables -> Show search results on the front-end ? 2. Database Design: I had a closer look at the car example of kongondo's post on "Approaches to categorizing site content", i.e. simple multiple categories. So the objective is to have typical search requests like this: "Show me all red, second-hand vans from Toyota with Diesel engine built in 2012 with a price below 15.000 EUR." Instead of adding the required fields directly to my car-template.php, I would create pages with sub-pages as attribute categories and sub-categories in the tree, which will then be referenced in my car-template.php as Page Fieldtypes, correct? I assume this keeps the attributes more manageable if further sub-categories need to be added in the future? So I would probably have a tree view similar like this: - Cars (car-template.php) -> this is where new vehicles will be added - Make -- Toyota -- Volkswagen -- BMW ... - Year -- 2000 -- 2001 -- 2002 -- 2003 ... - Color -- Red -- White -- Blue ... - Fuel -- Gas -- Diesel -- Electric ... - Condition -- New -- Used - Gear -- Automatic -- Manual -- Semi-automatic - Body - Compact - Convertible - Coupe - Off-Road - Van ... - etc. ... Now, there will probably be a couple of fields that won't be directly categories, such as price, mileage, description, images. Price and mileage, however, should be searchable. I assume those can be added directly to car-template.php instead of creating individual pages? Would appreciate your feedback if this makes sense.
  8. Dealing normally with simpler "brochure-style" websites, I am currently trying to figure out how to approach the following, more "advanced" problem in ProcessWire, so please bear with me: I would like to build a database of cars, which needs to be searchable by type, model, brand, registration date, mileage etc. For the database organisation, I already found kongondo's great post on "Approaches to categorizing site content". Will have to spend more time on the detailed organisation, while keeping things practical & manageable. For the search feature, I had a look at the search functions of Ryan's excellent Skyscrapers Site Profile. This uses the GET method in combination with search.php and the rendering functions in functions.php to request database entries that match the specified terms. Now the tricky part: I would like to send the search terms of every search request via email (PHPMailer) and ideally post them to the database as a new hidden page, which would require a POST request. I have created new pages before via the API based on form entries, so this should not be a problem. However, to my knowledge, you cannot POST and GET at the same time and from a security perspective, a GET request shouldn't change data on the server. Maybe this sounds trivial to a more experienced developer, but I would appreciate your advice. I am sure this is doable in ProcessWire (is there anything that isn't ?!?).
  9. I just emptied the cache of the AIOM-module and the error disappeared once I visited every single template. Not sure what the problem is...
  10. I just moved a site to a new Ubuntu 16 server and experience the following error: Warning: touch(): Utime failed: Operation not permitted in /var/www/html/wire/core/FileCompiler.php on line 329 Any idea what the problem could be?
  11. Neo

    Padloper showcase

    Would also like to see more e-commerce implementations with PadLoper. Couldn't find many so far...
  12. I tried both methods, adding "br" tags via the source code and also using Shift+Enter. It is always removed on "Save". I also tried <br /> and <br/>; same result. When I unselect "Remove non-breaking spaces (nbsp)" for the field and I add a line break wrapped in paragraph (which is quiet ugly), the <br> is transformed into nbsp. This creates a space with a new line, but is not really the intended outcome: <p>&nbsp;</p> I also tried to explicitly allow br tags in config-body.js without success: CKEDITOR.editorConfig = function( config ) { // Define changes to default configuration here. For example: // config.uiColor = '#AADC6E'; config.autoParagraph = false; config.AllowedContent = 'br[clear]'; }; Not sure if this is an issue with the CKEDitor plugin. Also tried the "Newlines to XHTML Line Breaks" but that creates a mess with a <br /> for every new line, which is the idea of the module, but does not give you much control. The site is running on Processwire 3.x version, which is currently my only installation on localhost, so I have not been able to verify this behavior yet in other or "clean" installations.
  13. I am trying to allow <br> tags (line breaks) in the input field of the CKeditor, which are currently stripped. The field does not use a text formatter, the content type is set to "Markup/HTML" and ACF and HTML Purifier have been switched off. I have also added "br" to the extra allowed content. It is still removed. Any idea how to get this working?
  14. Experiencing the same issue every time I access a page that does not exist, i.e. 404. Have you found a solution?
  • Create New...