We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Problem, PayPal

Paypal shop app not accessible from Editor's Apps menu

When logged in to Perch as an editor, the shop app is not accessible from the Apps menu, even though under Users -> Roles 'Access Shop' is checked (under 'System').

Other than granting the user full admin access, how can I allow an editor to edit the Paypal shop content? i.e. product details.

Adam Green

Adam Green 0 points

  • 4 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Can you post your Diagnostics Report?

PERCH INFORMATION

Perch: 2.8.18
Production mode: Production (100)
Installed apps: content (2.8.18), assets (2.8.18), categories (2.8.18), perch_blog (4.6), perch_forms (1.8.3), perch_shop_paypal (1.2.3)
DB driver: PDO
DB tables: perch2_blog_authors, perch2_blog_comments, perch2_blog_index, perch2_blog_posts, perch2_blog_posts_to_tags, perch2_blog_sections, perch2_blog_tags, 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_blog',
    'perch_forms',
    'perch_shop_paypal',
);
Scheduled tasks for perch_blog: delete_spam_comments (1440 mins)
Editor plug-ins: markitup
H1: cf9c875c1abbaefffdcbcea3e1bdf1ac
L1: 33bd6dc42a49e1568e9f26ae440067a2
headerColour: #ffffff
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 0
content_collapseList: 1
lang: en-gb
update_2.3.2: done
latest_version: 2.8.15
update_2.3.3: done
on_sale_version: 2.8.18
update_2.3.4: done
update_2.4.4: done
update_2.4.5: done
headerScheme: light
content_frontend_edit: 1
perch_blog_post_url: /blog/{postSlug}/
perch_blog_slug_format: %Y-%m-%d-{postTitle}
perch_blog_akismet_key:
perch_blog_max_spam_days: 7
dashboard: 0
content_hideNonEditableRegions: 0
perch_blog_comment_notify: 1
perch_shop_paypal_email: shop@thelittlemill.ie
perch_shop_product_url: shop/{productSlug}/
perch_shop_display_oos: 0
update_2.4.8: done
perch_blog_update: 5.0
update_2.4.9: done
update_2.8.13: done
hide_pwd_reset: 0
update_2.8.15: done
update_2.8.18: done
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_DATABASE: thelittl_db
PERCH_DB_USERNAME: thelittl_user
PERCH_PRODUCTION_MODE: 100
PERCH_DB_SERVER: localhost
PERCH_DB_PREFIX: perch2_
PERCH_TZ: UTC
PERCH_EMAIL_FROM: adam@bristlebird.com
PERCH_EMAIL_FROM_NAME: Adam Green
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/thelittl/public_html/perch
PERCH_CORE: /home/thelittl/public_html/perch/core
PERCH_RESFILEPATH: /home/thelittl/public_html/perch/resources
PERCH_RESPATH: /perch/resources
PERCH_HTML5: 1
PERCH_RWD: 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/thelittl/public_html/perch/templates
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
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.6.27
Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, enchant, hash, filter, ftp, gd, gettext, SPL, iconv, session, json, mbstring, mcrypt, standard, mysqlnd, mysqli, mysql, Phar, posix, Reflection, imap, SimpleXML, soap, sockets, exif, tidy, tokenizer, xml, xmlreader, xmlwriter, xsl, zip, cgi-fcgi, PDO, pdo_sqlite, OAuth, timezonedb, pdo_mysql, ionCube Loader
GD: Yes
ImageMagick: No
PHP max upload size: 32M
PHP max form post size: 32M
PHP memory limit: 128M
Total max uploadable file size: 32M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: No
DOCUMENT_ROOT: /home/thelittl/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: keep-alive
HTTP_COOKIE: _ga=GA1.2.378635383.1436966724; cmsa=1; PHPSESSID=493813218a6ba7bb6dbea39ccf576294
HTTP_HOST: thelittlemill.ie
HTTP_REFERER: http://thelittlemill.ie/perch/core/settings/diagnostics/
HTTP_UPGRADE_INSECURE_REQUESTS: 1
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36
PATH: /bin:/usr/bin
QUERY_STRING: extended
REDIRECT_STATUS: 200
REMOTE_ADDR: 195.189.129.206
REMOTE_PORT: 53260
REQUEST_METHOD: GET
REQUEST_URI: /perch/core/settings/diagnostics/?extended
SCRIPT_FILENAME: /home/thelittl/public_html/perch/core/settings/diagnostics/index.php
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
SERVER_ADDR: 89.200.138.65
SERVER_ADMIN: webmaster@thelittlemill.ie
SERVER_NAME: thelittlemill.ie
SERVER_PORT: 80
SERVER_PROTOCOL: HTTP/1.1
SERVER_SOFTWARE: Apache
UNIQUE_ID: Vlh061nIikEAABupXQgAAAAK
PHP_SELF: /perch/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1448637675.75
REQUEST_TIME: 1448637675
argc: 1
Drew McLellan

Drew McLellan 2638 points
Perch Support

Have they logged back in since the permissions were changed?

Yes. I just applied the 2.8.18 update today, logged in and out both as admin and editor, still no Shop in the Apps menu when logged in as editor.

I also tried changing a few other editor privileges under System (Change settings / Manage users / View update notices), disabled Access Shop, re-enabled it, etc, all to no avail.

Drew McLellan

Drew McLellan 2638 points
Perch Support

I can't find a reason for this. What version was the Shop when you originally installed it?

Hi Drew, I suspect it started at 1.1.2 (March 2014), upgraded to 1.2 (April 2014), then to 1.2.3 (Sept 2015). Thanks!

Oh heck, just spotted the site is now returning a 500 error - could this be the markitup bug? The site was on 2.8.15 when you announced the bug so I assumed it was OK, unless I forgot to update the markitup editor on the previous update?

It was working fine after the update to 2.8.18; I've just restored the core folder and replace the markitup editor folder with the one from 2.8.18 and it's all working again.

Looks like PerchUtil.class.php disappeared - here's the error log:

[28-Nov-2015 03:19:01 UTC] PHP Warning:  include(/home/thelittl/public_html/perch/core/lib/PerchUtil.class.php): failed to open stream: No such file or directory in /home/thelittl/public_html/perch/core/runtime/loader.php on line 44
[28-Nov-2015 03:19:01 UTC] PHP Warning:  include(): Failed opening '/home/thelittl/public_html/perch/core/lib/PerchUtil.class.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/thelittl/public_html/perch/core/runtime/loader.php on line 44
[28-Nov-2015 03:19:01 UTC] PHP Warning:  include(/home/thelittl/public_html/perch/core/lib/PerchFieldTypes.class.php): failed to open stream: No such file or directory in /home/thelittl/public_html/perch/core/runtime/loader.php on line 51
Drew McLellan

Drew McLellan 2638 points
Perch Support

I'd recommend putting your perch/core folder back.

Thanks Drew, I did that and the site is working again so panic over! Though I've no idea why essential core files started disappearing. Hopefully if it was the markitup vulnerability, the update has secured it; would you recommend changing all passwords (FTP, control panel, perch logins, mysql users etc)?

Back to the missing shop link from the editor's Apps menu...

Paypal shop versions went from 1.1.2 (March 2014), upgraded to 1.2 (April 2014), then to 1.2.3 (Sept 2015).

If there's no apparent reason for this, is there some way to hack the link into the Apps menu or anywhere else for that matter?

I enabled the dashboard but the Paypal shop doesn't feature there either for editors or admins. Any suggestions welcome! Thanks again.

Drew McLellan

Drew McLellan 2638 points
Perch Support

In the perch_shop_paypal/admin.php file the app is registered. It has a privilege check wrapped around it.

This is the contents of perch_shop_paypal/admin.php - anything amiss here?

    if ($CurrentUser->logged_in() && $CurrentUser->has_priv('perch_shop_paypal')) {
        $this->register_app('perch_shop_paypal', 'Shop', 1, 'Simple product shop', '1.2.3');
        $this->require_version('perch_shop_paypal', '2.8');

        $this->add_setting('perch_shop_paypal_email', 'Your PayPal email address', 'text', false, false, 'This is the email address linked to your account');

        $this->add_setting('perch_shop_product_url', 'Product page path', 'text', '/shop/product.php?s={productSlug}'); 
        $this->add_setting('perch_shop_display_oos', 'Display out of stock products', 'checkbox', "true",false,"If checked out of stock products will remain in the listings");
        $this->add_create_page('perch_shop_paypal', 'edit');
    }
Drew McLellan

Drew McLellan 2638 points
Perch Support

No, that's what it's supposed to look like.

So 'Shop' should appear in the editors' Apps menu once 'Access Shop' is checked in editor's roles?

The editor can access the shop page in perch via a direct link, i.e. http://domain.com/perch/addons/apps/perch_shop_paypal/ when they're logged in - is there a way to just manually add this to the admin interface somehow?

Drew McLellan

Drew McLellan 2638 points
Perch Support

You could try changing this:

if ($CurrentUser->logged_in() && $CurrentUser->has_priv('perch_shop_paypal')) {

to

if ($CurrentUser->logged_in()) {

Thanks Drew, that did the trick!