Forum

Thread tagged as: Problem, Error, Configuration

Buckets - What am I doing wrong?

Hi, I'm trying to set up buckets to keep images on my site organised, however I can't see to get it working.

My template looks like this:

<div class="central">
    <perch:if exists="page-icon"><img class="icon" src="<perch:content type="image" id="page-icon" label="Page Icon" width="180" bucket="feature icons" />" alt="" title="<perch:content id="main-title" type="text" label="Main Page Heading" required="true"/>"></perch:if>
    <h1><perch:content id="main-title" type="text" /></h1>
    <perch:content id="page-intro" type="textarea" label="Page Introduction" editor="redactor" html="true" size="m" required="true" />
</div>

<perch:repeater id="features" label="Features" max="6"><perch:before>
<div class="features">
    <ul></perch:before>
        <li>
            <perch:if exists="feature-icon"><img class="icon" src="<perch:content type="image" id="feature-icon" label="Feature Icon" width="80" bucket="icons" />" alt="" title="<perch:content id="features-title" type="text" label="Feature Title" required="true"/>"></perch:if>
            <h3><perch:content id="features-title" type="text"/></h3>
            <p><perch:content id="features-text" type="textarea" label="Feature Text" size="s" /></p>
        </li><perch:every count="3"><div class="clear"></div></perch:every><perch:after>
    </ul>
</div>

<div class="clear"></div>
</perch:after></perch:repeater>

When I add an image, the Bucket is shown as default, despite both 'feature icons' and 'icons' being specified above for the two image tags. The folders are being created on the server in the resources folder, but images are being saved in the default folder.

Diagnostics report

PERCH INFORMATION

Perch: 2.8.16
Production mode: Production (100)
Installed apps: content (2.8.16), assets (2.8.16), categories (2.8.16), dh_ga (1), perch_forms (1.8.3), perch_members (1.3)
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_members, perch2_members_forms, perch2_members_member_tags, perch2_members_sessions, perch2_members_tags, 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
Users: 1
App runtimes:
<?php
    $apps_list = array(
        'content', 
        'categories',
        'perch_forms',
        'perch_members',
        'dh_ga',
    );
Editor plug-ins: redactor, markitup
H1: eb8288b12a16e1df8ddb5d7b7071f83f
L1: f0237f5431df2ac73c3664a9bbdcbb76
headerColour: #ffffff
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 1
content_collapseList: 1
lang: en-gb
update_2.8.13: done
latest_version: 2.8.15
on_sale_version: 2.8.16
headerScheme: light
dashboard: 0
hide_pwd_reset: 0
content_hideNonEditableRegions: 0
content_frontend_edit: 0
perch_members_login_page: /mysite/
dh_ga_view_id: 44916103
update_2.8.16: done
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: haydnjam_haydn
PERCH_DB_SERVER: localhost
PERCH_DB_DATABASE: haydnjam_main
PERCH_DB_PREFIX: perch2_
PERCH_TZ: UTC
PERCH_EMAIL_FROM: haydn.james@hotmail.com
PERCH_EMAIL_FROM_NAME: Haydn Ward
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/haydnjam/public_html/perch
PERCH_CORE: /home/haydnjam/public_html/perch/core
PERCH_RESFILEPATH: /home/haydnjam/public_html/perch/resources
PERCH_RESPATH: /perch/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: /home/haydnjam/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_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.4.45
Zend: 2.4.0
OS: Linux
SAPI: cgi-fcgi
Safe mode: not detected
MySQL client: mysqlnd 5.0.10 - 20111026 - $Id: c85105d7c6f7d70d609bb4c000257868a40840ab $
MySQL server: 5.5.46-cll
Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, gettext, SPL, iconv, session, intl, json, mbstring, mcrypt, standard, mysql, mysqli, mysqlnd, Phar, posix, pspell, Reflection, imap, SimpleXML, soap, sockets, exif, tidy, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, cgi-fcgi, PDO, pdo_sqlite, pdo_mysql, SourceGuardian, yaml, ionCube Loader, Zend Guard Loader
GD: Yes
ImageMagick: No
PHP max upload size: 256M
PHP max form post size: 256M
PHP memory limit: 256M
Total max uploadable file size: 256M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: Yes
DOCUMENT_ROOT: /home/haydnjam/public_html
GATEWAY_INTERFACE: CGI/1.1
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_ACCEPT_ENCODING: gzip, deflate
HTTP_ACCEPT_LANGUAGE: en-us
HTTP_CONNECTION: keep-alive
HTTP_COOKIE: cmsa=1; cmssb=0; PHPSESSID=73b66d6d0992f775ee8eb58213ca86db; __utma=64562870.760519380.1429126344.1448145808.1448182414.120; __utmc=64562870; __utmz=64562870.1438628081.27.5.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided)
HTTP_HOST: www.haydnjames.co.uk
HTTP_REFERER: https://www.haydnjames.co.uk/perch/core/settings/diagnostics/
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/600.8.9 (KHTML, like Gecko) Version/7.1.8 Safari/537.85.17
PATH: /bin:/usr/bin
QUERY_STRING: extended
REDIRECT_STATUS: 200
REMOTE_ADDR: 151.227.99.51
REMOTE_PORT: 53897
REQUEST_METHOD: GET
REQUEST_URI: /perch/core/settings/diagnostics/?extended
SCRIPT_FILENAME: /home/haydnjam/public_html/perch/core/settings/diagnostics/index.php
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
SERVER_ADDR: 195.62.28.134
SERVER_ADMIN: webmaster@haydnjames.co.uk
SERVER_NAME: www.haydnjames.co.uk
SERVER_PORT: 80
SERVER_PROTOCOL: HTTP/1.1
SERVER_SOFTWARE: Apache
PHP_SELF: /perch/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1448189353.31
REQUEST_TIME: 1448189353
argc: 1
Haydn Ward

Haydn Ward 4 points

  • 5 years ago

Just to add to this, I've tried renaming my buckets, both two words, hyphenated and underscored. Still, images are added to default and no buckets appear in Admin every time :(

I have tested your template (copied and pasted exactly) and it works as expected for me.

Have you completed and saved an item in the region, then displayed the page? If yes, please verify the source code of the images to make sure if their in the correct bucket.

EDIT: Also make sure your clicking on the "Buckets" drop down when you visit assets app and see if your new bucket is listed in the dropdown.

When you first visit Asset App, all images will be shown in the preview. You have to click on the drop down for "Buckets" and choose the bucket you wish preview.

This is assets Filter Feature. But first view of assets will show ALL buckets. There is no folder like icon, only the drop down list.

Hi,

Yes, I've saved the region and uploaded countless images trying to get this to work.

All images are being saved in the default resource folder - despite sub folders being created for the buckets (so Perch is at least seeing that).

However, when I upload an image, it is going in the default bucket - the source code also shows them stored in the default folder.

In the Assets section there is only default under the buckets drop-down.

If this works for you... but not for me, what else could be affecting it?

Is this online or offline dev server? Can you provide a url.

Online, www.haydnjames.co.uk :)

All those images should be in a sub folder of some sort. But they're not.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Are you trying using the bucket with the space in its name? Can you try one that's neither a reserved folder name nor has spaces?

Hey

I'd already tried removing the space, replacing it with hyphen, an underscore and removing the space completely. Still no lucky.

Just went for something completely random 'haydnsimages' and still, no luck. The sub folder has been created though again.

:(

Drew McLellan

Drew McLellan 2638 points
Perch Support

Are the folders created with write permissions correctly set?

Yep, they all have identical permissions to the resource folder.

755 / rwxr-xr-x

Bit of an update on this one...

I've remove all the images completely and saved the page. Republished everything.

Gone back into the region to empty fields (as expected) and buckets are now there and working as originally expected.

So it seems the issue/bug (?) is relating to adding a bucket to an existing, already populated template.

Ok, so it's working now... That's great.

Yes, thanks for your help Robert.

Though I'm guessing there is still an issue there for Drew to add to his to do list! haha :)