Forum
Delete multiple regions?
Can I Delete empty regions in bulk?
I recent followed your tutorial to implement perch for a bi-lingual site.
Whilst doing a routine maintenance task I found out that empty regions are being created on the home page (but not others). I can't work out why but I have multiple 100's of empty regions with titles like this:
Address_Footer2 - 999' union select char(38,126,33),char(38,126,33),char(38,126,33),char(38,126,33),char(38,126,33),char(38,126,33),char(38,126,33),char(38,126,33),char(38,126,33),char(38,126,33),char(38,126,33),char(38,126,33),char(38,126,33),char(38,126
The biggest mystery is that I cannot recreate the problem and get this empty regions duplicated, when I manually refresh the page - it seems like there was a period of time this was happening and then it stopped.
What I want to do is delete all of these regions, but selecting them individually will take hours.
Below are my diagnostics and debug info:
Diagnostics:
PERCH INFORMATION
Perch: 2.7.4 Production mode: Production (100) Installed apps: content (2.7.4), assets (2.7.4), categories (2.7.4), perch_forms (1.7), perch_upgrade (1.4) DB driver: PDO DB tables: perch2_categories, perch2_category_counts, perch2_category_sets, perch2_content_index, perch2_content_items, perch2_content_regions, perch2_navigation, perch2_navigation_pages, perch2_page_templates, perch2_pages, perch2_resource_log, perch2_resource_tags, perch2_resources, perch2_resources_to_tags, perch2_settings, perch2_user_privileges, perch2_user_role_privileges, perch2_user_roles, perch2_users, perch_contentItems, perch_forms, perch_forms_responses, perch_pages, perch_pages_navgroups, perch_pages_templates, perch_settings, perch_users Users: 1 App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_forms', 'perch_upgrade', ); Editor plug-ins: markitup H1: 1373a9b4f89186004bb379489b8d4373 L1: f2c549c84544296c2a83b167767f44d0 headerColour: #ffffff content_singlePageEdit: 1 helpURL: siteURL: / hideBranding: 0 content_collapseList: 1 lang: en-gb update_2.6.3: done latest_version: 2.5.3 on_sale_version: 2.7.4 headerLinkColour: #000000 linkColour: #333333 perch_pages_editorMayDeletePages: 1 perch_pages_folders: /staff editorMayDeleteRegions: 0 perch_forms_editorMayConfigure: 1 perch_forms_editorMayDelete: 1 update_2.7.4: done PERCH_DEVELOPMENT: 10 PERCH_STAGING: 50 PERCH_PRODUCTION: 100 PERCH_DB_USERNAME: cl16-peregrin PERCH_DB_SERVER: localhost PERCH_DB_DATABASE: cl16-peregrin PERCH_DB_PREFIX: perch2_ PERCH_TZ: UTC PERCH_EMAIL_FROM: DELETED BY ME PERCH_EMAIL_FROM_NAME: Jon beveridge PERCH_LOGINPATH: /perch PERCH_PATH: /home/sites/peregrine-iom.com/public_html/perch PERCH_CORE: /home/sites/peregrine-iom.com/public_html/perch/core PERCH_RESFILEPATH: /home/sites/peregrine-iom.com/public_html/perch/resources PERCH_RESPATH: /perch/resources PERCH_HTML5: 1 PERCH_DEBUG: 1 PERCH_RUNWAY: PERCH_ERROR_MODE: DIE PERCH_DATE_LONG: %d %B %Y PERCH_DATE_SHORT: %d %b %Y PERCH_TIME_SHORT: %H:%M PERCH_TIME_LONG: %H:%M:%S PERCH_PREVIEW_ARG: preview PERCH_TEMPLATE_PATH: /home/sites/peregrine-iom.com/public_html/perch/templates PERCH_DEFAULT_DOC: index.php PERCH_DEFAULT_EXT: .php PERCH_PRODUCTION_MODE: 100 PERCH_RWD: PERCH_HTML_ENTITIES: PERCH_SSL: PERCH_AUTH_PLUGIN: PERCH_DB_CHARSET: utf8 PERCH_DB_PORT: PERCH_DB_SOCKET: HOSTING SETTINGS
PHP: 5.5.9 Zend: 2.5.0 OS: Linux SAPI: cgi-fcgi Safe mode: not detected MySQL client: mysqlnd 5.0.11-dev - 20120503 - $Id: bf9ad53b11c9a57efdb1057292d73b928b8c5c77 $ MySQL server: 5.5.35 Extensions: Core, date, ereg, libxml, openssl, pcre, zlib, bz2, calendar, ctype, hash, filter, ftp, gettext, gmp, SPL, iconv, pcntl, readline, Reflection, session, standard, shmop, SimpleXML, sockets, mbstring, tokenizer, xml, cgi-fcgi, bcmath, curl, dom, enchant, fileinfo, gd, imap, intl, json, ldap, exif, mcrypt, mssql, mysqlnd, mysql, mysqli, odbc, PDO, pdo_dblib, pdo_mysql, PDO_ODBC, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, pspell, recode, soap, sqlite3, sysvmsg, sysvsem, sysvshm, tidy, wddx, xmlreader, xmlrpc, xmlwriter, xsl, zip, mhash GD: Yes (image sharpening disabled, #66714) ImageMagick: No PHP max upload size: 64M PHP max form post size: 64M PHP memory limit: 128M Total max uploadable file size: 64M Resource folder writeable: Yes Session timeout: 24 minutes Native JSON: Yes Filter functions: Yes Transliteration functions: Yes PATH: /usr/local/bin:/usr/bin:/bin UNIQUE_ID: VJAV0X8AAAEAACmborAAAAAG SCRIPT_URL: /perch/core/settings/diagnostics/ SCRIPT_URI: https://peregrine-iom.com/perch/core/settings/diagnostics/ HTTP_HOST: peregrine-iom.com HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8 HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36 HTTP_REFERER: https://peregrine-iom.com/perch/core/settings/diagnostics/ HTTP_ACCEPT_ENCODING: gzip,deflate,sdch HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8,zh-CN;q=0.6,zh;q=0.4 HTTP_COOKIE: PHPSESSID=3i6uct5to71r9scn3bks82ga22; cmsa=1; __utma=188707881.2053824789.1418722091.1418722091.1418726603.2; __utmb=188707881.0.10.1418726603; __utmc=188707881; __utmz=188707881.1418722091.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none) HTTP_CONNECTION: close SERVER_SIGNATURE: <address>Apache/2.4.9 (Unix) Server at peregrine-iom.com Port 80</address> SERVER_SOFTWARE: Apache/2.4.9 (Unix) SERVER_NAME: peregrine-iom.com SERVER_ADDR: 10.0.1.167 SERVER_PORT: 80 REMOTE_ADDR: 217.28.0.210 DOCUMENT_ROOT: /home/sites/peregrine-iom.com/public_html REQUEST_SCHEME: http CONTEXT_DOCUMENT_ROOT: /home/sites/peregrine-iom.com/public_html SERVER_ADMIN: root@localhost SCRIPT_FILENAME: /home/sites/peregrine-iom.com/public_html/perch/core/settings/diagnostics/index.php REMOTE_PORT: 54352 GATEWAY_INTERFACE: CGI/1.1 SERVER_PROTOCOL: HTTP/1.1 REQUEST_METHOD: GET QUERY_STRING: extended REQUEST_URI: /perch/core/settings/diagnostics/?extended SCRIPT_NAME: /perch/core/settings/diagnostics/index.php PHP_SELF: /perch/core/settings/diagnostics/index.php REQUEST_TIME_FLOAT: 1418728914.0265 REQUEST_TIME: 1418728914
Debug: Debug Message SELECT u.*, r.* FROM perch2_users u, perch2_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='3bf0e2826425d51a56a2aa5022272739' LIMIT 1 UPDATE perch2_users SET userHash='9d7fef7af0d2a46292a00ef253bff685' WHERE userID=1 SELECT p.privKey FROM perch2_user_privileges p SELECT * FROM (SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=1 OR userID=0 ORDER BY userID DESC) AS settings GROUP BY settingID SHOW TABLES SELECT COUNT(*) FROM perch2_users SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0 Queries: 8
Thanks.
Can you show us the code you're using on your homepage? It sounds like you might be creating regions with no filtering on the input.
There's not a bulk delete, I'm afraid.
Hi Drew - full index.php mark up as follows.
Thank you.
It might also be worth mentioning at ALL the perch content regions were duplicated in the same way; not just the Address_Footer2.
You should really check to see what language you're setting. Replace this:
with something like this
Obviously customising the language options.