Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error caused when attribute has no 'absolute_url' #1887

Closed
rileydog opened this issue Dec 28, 2016 · 2 comments
Closed

Error caused when attribute has no 'absolute_url' #1887

rileydog opened this issue Dec 28, 2016 · 2 comments

Comments

@rileydog
Copy link

rileydog commented Dec 28, 2016

This is continued from: https://community.plone.org/t/error-from-plone-app-layout-globals-portal/3204

Below is just the log error. (Note: error does not appear to effect site. Can't tell for certain because I am resolving a memory overuse issue.)

==================================
2016-11-11T15:00:38 ERROR Zope.SiteErrorLog 1478876438.090.780612564538
http://www.lwhsboosters.org/robots.txt
Traceback (innermost last):
Module ZPublisher.Publish, line 138, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 48, in call_object
Module Products.CMFPlone.browser.robots, line 24, in __call__
Module plone.memoize.view, line 67, in memogetter
Module plone.app.layout.globals.portal, line 48, in portal_url
AttributeError: 'NoneType' object has no attribute 'absolute_url'
===========================================================

Site details:

Plone 5.0.6rc1 (5016)
CMF 2.2.10
Zope 2.13.24
Python 2.7.5 (default, Nov 6 2016, 00:28:07) [GCC 4.8.5 20150623 (Red Hat 4.8.5-11)]
PIL 3.3.1 (Pillow)
======================

Activated addons:

docent.group.vocabularies 
Data grid field for z3c.form 
Coming soon Content Rules 
Workflow Policy Support 
===================

Please contact me off line if I can provide more details. I can provide a site admin login if helpful

thanks for looking into this.

wayne

@mauritsvanrees
Copy link
Sponsor Member

mauritsvanrees commented Dec 28, 2016

The problem is that that http://www.lwhsboosters.org is not a Plone Site: it is the Zope root object.
The Plone Site is one level deeper, at http://www.lwhsboosters.org/LWHS_Boosters. If you call http://www.lwhsboosters.org/LWHS_Boosters/robots.txt everything works fine.

My advice would be to not expose the Zope root object to the web: in your front web server (likely nginx or Apache) make sure requests for http://www.lwhsboosters.org end up at the LWHS_Boosters item.

Having said that, it is not nice that the code fails. It should see that it is being called outside of Plone (checking if portal_state.portal() is None) and then return an empty string, or maybe a basic robots.txt:

User-agent: *
Disallow:

@rileydog
Copy link
Author

This is confusing because I use VHM to rewrite directly to the plone site (see attached)
rewrite rules
This has been working (at least to the user and myself - site admin) for many months.

However, for awhile, I had been receiving strange behavior recently which agrees with what you have explained here. On different browsers (MS browser and FF), I was receiving different behaviors. That is, when url entered into one browser it went directly to the site, for the other browser, it went to the Plone setup page.
However, if you check now, you'll see that the url: lwhsboosters.org goes directly to the website. I haven't changed VHM since site was started .

How can this be?
Does this error matter?
More importantly is the issue of VHM.
I've become very adept at breaking Plone lately. Not a skill I want to continue to improve. ")

Appreciate any help. If you'd like to log into site, I can give you credentials offline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants