Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ayush Tiwari
erp5
Commits
380f9152
Commit
380f9152
authored
Nov 27, 2017
by
Ayush Tiwari
Committed by
Ayush Tiwari
Dec 21, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SQLCatalog: Use isIndexingRequired as ERP5Site object has no longer isIndexable attribute
parent
c46086d2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
12 deletions
+12
-12
product/ERP5/Document/BusinessTemplate.py
product/ERP5/Document/BusinessTemplate.py
+1
-1
product/ERP5/ERP5Site.py
product/ERP5/ERP5Site.py
+3
-3
product/ZSQLCatalog/SQLCatalog.py
product/ZSQLCatalog/SQLCatalog.py
+8
-8
No files found.
product/ERP5/Document/BusinessTemplate.py
View file @
380f9152
...
...
@@ -5364,7 +5364,7 @@ Business Template is a set of definitions, such as skins, portal types and categ
if
update_catalog
:
catalog
=
_getCatalogValue
(
self
)
if
(
catalog
is
None
)
or
(
not
site
.
isIndex
able
):
if
(
catalog
is
None
)
or
(
not
site
.
isIndex
ingRequired
()
):
LOG
(
'Business Template'
,
0
,
'no SQL Catalog available'
)
update_catalog
=
0
else
:
...
...
product/ERP5/ERP5Site.py
View file @
380f9152
...
...
@@ -237,7 +237,7 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
last_id
=
0
icon
=
'portal.gif'
# Default value, prevents error during upgrade
isIndex
able
=
ConstantGetter
(
'isIndexable
'
,
value
=
True
)
isIndex
ingRequired
=
ConstantGetter
(
'isIndexingRequired
'
,
value
=
True
)
# There can remain a lot a activities to be processed once all BT5 are
# installed, and scalability tests want a reliable way to know when the site
# is ready to be tortured.
...
...
@@ -1885,7 +1885,7 @@ class ERP5Generator(PortalGenerator):
portal
=
self
.
klass
(
id
=
id
)
# Make sure reindex will not be called until business templates
# will be installed
setattr
(
portal
,
'isIndex
able'
,
ConstantGetter
(
'isIndexable
'
,
value
=
False
))
setattr
(
portal
,
'isIndex
ingRequired'
,
ConstantGetter
(
'isIndexingRequired
'
,
value
=
False
))
# This is only used to refine log level.
# Has no functional use, and should never have any:
...
...
@@ -2198,7 +2198,7 @@ class ERP5Generator(PortalGenerator):
def
setupIndex
(
self
,
p
,
**
kw
):
# Make sure all tools and folders have been indexed
if
kw
.
get
(
'reindex'
,
1
):
setattr
(
p
,
'isIndex
able'
,
ConstantGetter
(
'isIndexable
'
,
value
=
True
))
setattr
(
p
,
'isIndex
ingRequired'
,
ConstantGetter
(
'isIndexingRequired
'
,
value
=
True
))
# Clear portal ids sql table, like this we do not take
# ids for a previously created web site
p
.
portal_ids
.
clearGenerator
(
all
=
True
)
...
...
product/ZSQLCatalog/SQLCatalog.py
View file @
380f9152
...
...
@@ -1149,8 +1149,8 @@ class Catalog(Folder,
uid_list
=
[
x
.
uid
for
x
in
method
(
count
=
UID_BUFFER_SIZE
,
instance_id
=
instance_id
)
if
x
.
uid
!=
0
]
uid_buffer
.
extend
(
uid_list
)
security
.
declarePrivate
(
'isIndex
able
'
)
def
isIndex
able
(
self
):
security
.
declarePrivate
(
'isIndex
ingRequired
'
)
def
isIndex
ingRequired
(
self
):
"""
This is required to check in many methods that
the site root and zope root are indexable
...
...
@@ -1158,8 +1158,8 @@ class Catalog(Folder,
zope_root
=
self
.
getZopeRoot
()
site_root
=
self
.
getSiteRoot
()
# XXX-JPS - Why don't we use getPortalObject here ?
root_indexable
=
int
(
getattr
(
zope_root
,
'isIndex
able
'
,
1
))
site_indexable
=
int
(
getattr
(
site_root
,
'isIndex
able
'
,
1
))
root_indexable
=
int
(
getattr
(
zope_root
,
'isIndex
ingRequired
'
,
1
))
site_indexable
=
int
(
getattr
(
site_root
,
'isIndex
ingRequired
'
,
1
))
if
not
(
root_indexable
and
site_indexable
):
return
False
return
True
...
...
@@ -1206,7 +1206,7 @@ class Catalog(Folder,
Similar problems may happen with relations and acquisition of uid values (ex. order_uid)
with the risk of graph loops
"""
if
not
self
.
getPortalObject
().
isIndex
able
():
if
not
self
.
getPortalObject
().
isIndex
ingRequired
():
return
None
with
global_reserved_uid_lock
:
...
...
@@ -1378,7 +1378,7 @@ class Catalog(Folder,
LOG
(
'ZSLQCatalog.SQLCatalog:catalogObjectList'
,
WARNING
,
'idxs is ignored in this function and is only provided to be compatible with CMFCatalogAware.reindexObject.'
)
if
not
self
.
getPortalObject
().
isIndex
able
():
if
not
self
.
getPortalObject
().
isIndex
ingRequired
():
return
# Reminder about optimization: It might be possible to issue just one
...
...
@@ -1632,7 +1632,7 @@ class Catalog(Folder,
"""
Set the path as deleted
"""
if
not
self
.
getPortalObject
().
isIndex
able
():
if
not
self
.
getPortalObject
().
isIndex
ingRequired
():
return
None
if
uid
is
None
and
path
is
not
None
:
...
...
@@ -1665,7 +1665,7 @@ class Catalog(Folder,
XXX Add filter of methods
"""
if
not
self
.
getPortalObject
().
isIndex
able
():
if
not
self
.
getPortalObject
().
isIndex
ingRequired
():
return
None
if
uid
is
None
and
path
is
not
None
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment