Commit 2c693d69 authored by Vincent Pelletier's avatar Vincent Pelletier

Save/restore HTTP_ACCEPT_LANGUAGE when activating/invoking, respectively.

Call iHotfix to (re)create its data structures.
Add iHotfix-related cleanup.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20922 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7f115059
master PROD_COMP2108@20150821 PROD_COMP2117@20150821 accessor_setter_security accounting_constraint_bug_ignore_acquired_source_destination_when_closing accounting_grouping_reference_ignore_mirror_account bt_20150921-1487839 bt_component_broken bt_review budget_component budget_time_variation cleanup/translation_mapping_utf8 cleanup_interface code_mirror code_mirror_jerome_patches_2file_bt codemirror_5.13.4 configurator_cleanups delivery_type_information dist-0.4.63 do_not_modify_folder_while_migratinng erp5-vifib-print-and-hashseed feat/accounting_add_back_third_party_column_in_gl feat/accounting_balance_sheet_profit_and_loss_cleanups feat/accounting_grouping_dialog_search_by_section_category_and_fixs feat/accounting_internal_invoice feat/accounting_sort_aged_balance feat/activities-clean-shutdown feat/bank_reconciliation_direct_stock_columns feat/bt_xml_zope2_zope4 feat/cmfactivity_notification feat/coverage feat/data_protection feat/doc-generator feat/jedi feat/less-seleniumrunner-install feat/line-report-parrallel feat/monaco-ruff feat/note_before_migration feat/pdm_measure_cell_range feat/py2zope4 feat/random_runUnitTest_port feat/remove_owner_role_permissions_on_document_workflow feat/restricted_collections feat/simplemde feat/simplemde-text-editor feat/support_request_translation feat/yapf fix/#20170313-5DDBB0 fix/988_workaround fix/auth-cookies fix/bug_20161227-D1FA4 fix/category-export fix/check_authentication_policy fix/configurator_consistency fix/control-characters-in-odf-syles fix/egg_test_revision_history fix/enable-xml-rpc fix/erp5testnode-build-failures fix/graph_editor fix/hashseed fix/mobyt-new-url fix/python3-syntax fix/remove_obfuscated_url_from_test fix/runUnitTest_localhost fix/testnode-killProcess fix/testnode-loose-supervisord fix/testnode_proctitle fix/trial_balance_empty_gap fix_func_test fixes for_testrunner_1 graph_editor_wip inventory_api_do_not_group_movement_history_list inventory_api_flow inventory_api_group_by_time_sequence inventory_api_group_by_time_sequence_backport_master_no_guard_on_workflow_transition inventory_api_group_by_time_sequence_first_try inventory_api_group_by_time_sequence_rebased inventory_api_interpolation_method jedi_autocomplete jedi_python_autocomplete jerome_clone_transformation ledger_vs_grouping_reference linecache_ipython3 listbox_module_proxy_field listbox_proxy_field_more_columns listbox_unicode_url_method live_test_lets_crash mass_workflow master_calendar_wip_patchs master_no_guard_on_workflow_transition_plus_calendar_wip_patchs_plus_upgrader_refactoring move_budget_to_component ods_style_sheet_per_report_section_deferred_style_before_rebase old_patches ooo_url_remove_address_port palo periodicity_getNextPeriodicityDate_test_give_up pivot_table py2zope4 pyflake_vs_pylint shop-box-work small_ui_fixes_editable_field sms_activate_before_rebase sms_more_than_140_characters software_link spellcheck_slowdown_chrome style_on_accounting_reports tax_return_and_type_of_type test/selenium_repro testnode_runner testnode_runner2 testnode_runner_clean testnode_software_link tmp/authentication_policy2_wip tmp/authentication_policy_fixes_before_rebase tmp/authentication_policy_no_immediateReindex tmp/constructUrlFor tmp/georges tmp/invalid_html_to_verify_w3_validator tmp/mr185_review tmp/rjs-translations tmp/tmp tmp/tmpx tmp1 tmp_commits_for_nicolas upgrader_post_upgrade_after_upgrade_activities web_site_clone_before_traversal_hooks wip/catalog_tool_extra_column_list_for_inventory_api_slot_index wip/chartsjs_and_worklists wip/cmf_activity_runtime_grouped wip/component_editor_gadget wip/configurator_trade wip/copy_reg_NamedAssignment wip/corporate_cloudooo_fonts wip/empty_criterion wip/feat/payment_transaction_group_ERPJS wip/interpolation_0_rebase wip/loyalty_with_tml wip/monaco wip/monaco-editor wip/monaco-jshint wip/neo wip/quick_erp5_test wip/restricted_iterator wip/seleniumserver wip/stock_browser wip/testUpgradeInstanceWithOldDataFs_reference_json wip/testnode-kill-previous-before-reinitializing wip/tmp wip/wip wip/xiaowu_convert_round_debit_credit wip_search_portal_component wipwipwip work zope4py2 zope4py2b zope4py3 zope4py3-before-arnaud-rebase zope4py3-bt-protocol1onpy3 zope4py3-rebase-starting-point zope4py3-tmp zope4py3-wip 0.4.59.1 0.4.59 wip/configurator_trade_old erp5.util-0.4.64 erp5.util-0.4.63 erp5.util-0.4.62 erp5.util-0.4.61 erp5.util-0.4.58 erp5.util-0.4.57 erp5.util-0.4.56 erp5.util-0.4.55 erp5.util-0.4.54 erp5.util-0.4.53 erp5.util-0.4.52 erp5.util-0.4.49 erp5.util-0.4.46 erp5.util-0.4.44 erp5.util-0.4.43 erp5.util-0.4.41 erp5.util-0.4.40 erp5.util-0.4.37 erp5.util-0.4.1 erp5.util-0.4 erp5.util-0.3 erp5.util-0.2 erp5.util-0.1
No related merge requests found
......@@ -49,6 +49,7 @@ from Acquisition import aq_inner
from ActivityBuffer import ActivityBuffer
from zExceptions import ExceptionFormatter
from BTrees.OIBTree import OIBTree
from Products import iHotfix
from ZODB.POSException import ConflictError
from Products.MailHost.MailHost import MailHostError
......@@ -144,6 +145,7 @@ class Message:
self.request_info = dict(
SERVER_URL=request.other['SERVER_URL'],
VirtualRootPhysicalPath=request.other.get('VirtualRootPhysicalPath'),
HTTP_ACCEPT_LANGUAGE=request.environ.get('HTTP_ACCEPT_LANGUAGE'),
_script=list(request._script))
def getObject(self, activity_tool):
......@@ -830,7 +832,19 @@ class ActivityTool (Folder, UniqueObject):
virtual_root_path = request_info.get('VirtualRootPhysicalPath')
if virtual_root_path:
new_request.other['VirtualRootPhysicalPath'] = virtual_root_path
new_request.environ['HTTP_ACCEPT_LANGUAGE'] = request_info['HTTP_ACCEPT_LANGUAGE']
new_request._script = request_info['_script']
# Replace iHotfix Context, saving existing one
ihotfix_context = iHotfix.Context(new_request)
id = get_ident()
iHotfix._the_lock.acquire()
try:
old_ihotfix_context = iHotfix.contexts.get(id)
iHotfix.contexts[id] = ihotfix_context
finally:
iHotfix._the_lock.release()
# Execute iHotfix "patch 2"
new_request.processInputs()
new_request_container = request_container.__class__(REQUEST=new_request)
# Recreate acquisition chain.
......@@ -839,9 +853,18 @@ class ActivityTool (Folder, UniqueObject):
for item in base_chain:
my_self = item.__of__(my_self)
else:
old_ihotfix_context = None
my_self = self
LOG('CMFActivity.ActivityTool.invoke', INFO, 'Strange: invoke is called outside of acquisition context.')
message(my_self)
if old_ihotfix_context is not None:
# Restore iHotfix context
id = get_ident()
iHotfix._the_lock.acquire()
try:
iHotfix.contexts[id] = old_ihotfix_context
finally:
iHotfix._the_lock.release()
if logging:
LOG('Activity Tracking', INFO, 'invoked message')
if my_self is not self: # We rewrapped self
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment