Forum

Thread tagged as: Problem, Error

Resource Buckets Issue

Hi guys. I started using buckets for the first time today in my assets and ran into a major problem.

My buckets.php

<?php 
    return array(
        'head_protection' => array(
            'web_path'  => '/ucontrol/resources/head_protection',
            'file_path' => $_SERVER['DOCUMENT_ROOT'].'/ucontrol/resources/head_protection'
        ),
        'ear_protection' => array(
            'web_path' => '/ucontrol/resources/ear_protection',
            'file_path' => $_SERVER['DOCUMENT_ROOT'].'/ucontrol/resources/ear_protection'
        ),
        'masks' => array(
            'web_path' => '/ucontrol/resources/masks',
            'file_path' => $_SERVER['DOCUMENT_ROOT'].'/ucontrol/resources/masks'
        ),
        'eye_protection' => array(
            'web_path' => '/ucontrol/resources/eye_protection',
            'file_path' => $_SERVER['DOCUMENT_ROOT'].'/ucontrol/resources/eye_protection'
        ),
        'hand_protection' => array(
            'web_path' => '/ucontrol/resources/hand_protection',
            'file_path' => $_SERVER['DOCUMENT_ROOT'].'/ucontrol/resources/hand_protection'
        ),
        'face_protection' => array(
            'web_path' => '/ucontrol/resources/face_protection',
            'file_path' => $_SERVER['DOCUMENT_ROOT'].'/ucontrol/resources/face_protection'
        ),
        'footwear' => array(
            'web_path' => '/ucontrol/resources/footwear',
            'file_path' => $_SERVER['DOCUMENT_ROOT'].'/ucontrol/resources/footwear'
        ),
        'first_aid' => array(
            'web_path' => '/ucontrol/resources/first_aid',
            'file_path' => $_SERVER['DOCUMENT_ROOT'].'/ucontrol/resources/first_aid'
        ),
        'high_visibility' => array(
            'web_path' => '/ucontrol/resources/high_visibility',
            'file_path' => $_SERVER['DOCUMENT_ROOT'].'/ucontrol/resources/high_visibility'
        ),
        'clothing_and_workwear' => array(
            'web_path' => '/ucontrol/resources/clothing_and_workwear',
            'file_path' => $_SERVER['DOCUMENT_ROOT'].'/ucontrol/resources/clothing_and_workwear'
        ),
        'rainwear' => array(
            'web_path' => '/ucontrol/resources/rainwear',
            'file_path' => $_SERVER['DOCUMENT_ROOT'].'/ucontrol/resources/rainwear'
        ),
        'disposable_clothing' => array(
            'web_path' => '/ucontrol/resources/disposable_clothing',
            'file_path' => $_SERVER['DOCUMENT_ROOT'].'/ucontrol/resources/disposable_clothing'
        ),
        'spill_control' => array(
            'web_path' => '/ucontrol/resources/spill_control',
            'file_path' => $_SERVER['DOCUMENT_ROOT'].'/ucontrol/resources/spill_control'
        )
    );
?>

However when I log into my Perch and Filter by Bucket there are a couple of extra options added in. One is 'Clothing_and_wor' and the other is 'Disposable_cloth'. The odd thing is, the actual filters for 'Clothing_and_workwear' and 'Disposable_clothing' are there too.

The issue is that when I select 'Clothing_and_workwear' as the bucket to upload to, the images don't show in the assets panel. When I click on the image and 'Download original file' it takes me to '/ucontrol/resources/clothing_and_wor/tx62nar-1.jpg'

But if I change the URL to /ucontrol/resources/clothing_and_workwear/tx62nar-1.jpg it works perfectly!

Any ideas why it seems to be uploading to the incorrect path and why there are two options?

Diagnostics below:

Perch: 2.8.15
Production mode: Production (100)
Installed apps: content (2.8.15), assets (2.8.15), categories (2.8.15), perch_forms (1.8.3), perch_shop_paypal (1.2.2)
DB driver: PDO
DB tables: perch2_categories, perch2_category_counts, perch2_category_sets, perch2_content_index, perch2_content_items, perch2_content_regions, perch2_forms, perch2_forms_responses, 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_shop_categories, perch2_shop_log, perch2_shop_orders, perch2_shop_product_options, perch2_shop_products, perch2_shop_products_to_categories, perch2_user_privileges, perch2_user_role_privileges, perch2_user_roles, perch2_users
Users: 3
App runtimes:
<?php
    $apps_list = array(
        'content', 
        'categories',
        'perch_shop_paypal',
    );
Editor plug-ins: ckeditor, markitup
H1: a4df2b706d5f8d12d8991a36fd7f87ca
L1: b37fbe8c35408356952d6eefee107fac
headerColour: #ffffff
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 1
content_collapseList: 1
lang: en-gb
update_2.8.4: done
on_sale_version: 2.8.15
headerScheme: light
dashboard: 0
hide_pwd_reset: 0
content_hideNonEditableRegions: 0
content_frontend_edit: 0
logoPath: /ucontrol/resources/ucontrol.png
perch_shop_paypal_email:
perch_shop_product_url: /shop/product.php?s={productSlug}
perch_shop_display_oos: 1
latest_version: 2.8.15
update_2.8.8: done
update_2.8.15: done
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: industri16_db
PERCH_DB_SERVER: 10.169.0.7
PERCH_DB_DATABASE: industri16_db
PERCH_DB_PREFIX: perch2_
PERCH_TZ: Europe/London
PERCH_EMAIL_FROM: steven@designbyconet.com
PERCH_EMAIL_FROM_NAME: Steven Legge
PERCH_LOGINPATH: /ucontrol
PERCH_PATH: /var/sites/i/industrialsuppliesni.co.uk/public_html/ucontrol
PERCH_CORE: /var/sites/i/industrialsuppliesni.co.uk/public_html/ucontrol/core
PERCH_RESFILEPATH: /var/sites/i/industrialsuppliesni.co.uk/public_html/ucontrol/resources
PERCH_RESPATH: /ucontrol/resources
PERCH_HTML5: 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_DEBUG:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /var/sites/i/industrialsuppliesni.co.uk/public_html/ucontrol/templates
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_RWD:
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_STRIPSLASHES:
PERCH_PROGRESSIVE_FLUSH: 1
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
PERCH_SESSION_TIMEOUT_MINS: 20
HOSTING SETTINGS

PHP: 5.6.8
Zend: 2.6.0
OS: Linux
SAPI: cgi-fcgi
Safe mode: not detected
MySQL client: mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $
MySQL server: 5.6.21
Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bcmath, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, gettext, SPL, iconv, session, json, ldap, mbstring, mcrypt, mssql, standard, mysql, mysqlnd, mysqli, PDO, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, Reflection, imap, SimpleXML, soap, sockets, exif, tidy, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, cgi-fcgi, memcached, memcache, mhash, ionCube Loader, Zend Guard Loader
GD: Yes
ImageMagick: No
PHP max upload size: 100M
PHP max form post size: 100M
PHP memory limit: 128M
Total max uploadable file size: 100M
Resource folder writeable: Yes
Session timeout: 240 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: No
DOCUMENT_ROOT: /var/sites/i/industrialsuppliesni.co.uk/public_html
GATEWAY_INTERFACE: CGI/1.1
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_ACCEPT_ENCODING: gzip, deflate, sdch
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8
HTTP_CONNECTION: close
HTTP_COOKIE: _ga=GA1.3.929239785.1443783860; cmsa=1; PHPSESSID=7e4f9dea97b61335a9bd333cef94e328
HTTP_HOST: industrialsuppliesni.co.uk
HTTP_REFERER: https://industrialsuppliesni.co.uk/ucontrol/core/settings/diagnostics/
HTTP_UPGRADE_INSECURE_REQUESTS: 1
HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36
HTTP_X_FORWARDED_FOR: 78.137.188.42
PATH: /bin
QUERY_STRING: extended
REDIRECT_STATUS: 200
REMOTE_ADDR: 78.137.188.42
REMOTE_PORT: 60263
REQUEST_METHOD: GET
REQUEST_URI: /ucontrol/core/settings/diagnostics/?extended
SCRIPT_FILENAME: /var/sites/i/industrialsuppliesni.co.uk/public_html/ucontrol/core/settings/diagnostics/index.php
SCRIPT_NAME: /ucontrol/core/settings/diagnostics/index.php
SERVER_ADDR: 10.168.1.127
SERVER_ADMIN: you@example.com
SERVER_NAME: industrialsuppliesni.co.uk
SERVER_PORT: 80
SERVER_PROTOCOL: HTTP/1.1
SERVER_SOFTWARE: Apache
PHP_SELF: /ucontrol/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1447157936.81
REQUEST_TIME: 1447157936
argc: 1
Chris McGuicken

Chris McGuicken 1 points

  • 6 years ago
Simon Clay

Simon Clay 127 points

I think it may be caused by the bucket names being too long. I think the docs state that they can only be 16 characters.

Drew McLellan

Drew McLellan 2638 points
Perch Support

As Simon says - bucket names are currently limited to 16 characters for file system compatibility. We may relax that in a future release.

OK guys, thank you for answering so quickly.

I have reduced all the variables to below 16 characters. Next question... it seems to have left the old 'Disposable_cloth' and 'Clothing_and_wor' buckets in Perch. How can I go about removing these?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Did you upload assets to those buckets?