Skip to content
  • This project
    • Loading...
  • Sign in

nexedi / erp5

Go to a project
Toggle navigation
Toggle navigation pinning
  • Projects
  • Groups
  • Snippets
  • Help
  • Project
  • Activity
  • Repository
  • Pipelines
  • Graphs
  • Merge Requests 111
  • Wiki
  • Snippets
  • Network
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Merged
Merge Request !824 opened 2019-01-17 10:16:28 UTC by Xiaowu Zhang@xiaowu.zhang

erp5_ods_style: fix the way to get form id

if i have a url like: https://erp5xxx/form_idxxx?relative_item_relative_url=item_module/7817

with the old way, form id will be 7817

Edited 2019-02-27 07:45:54 UTC
Request to merge xiaowu.zhang:bug into master
×

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch https://lab.nexedi.com/xiaowu.zhang/erp5.git bug
git checkout -b xiaowu.zhang/erp5-bug FETCH_HEAD

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git checkout master
git merge --no-ff xiaowu.zhang/erp5-bug

Step 4. Push the result of the merge to GitLab

git push origin master

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

Merged by Xiaowu Zhang 2019-01-21 08:49:24 UTC

The changes were merged into master.

  • Discussion 10
  • Commits 1
  • Changes 1
  • {{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
  • @xiaowu.zhang Xiaowu Zhang
    @xiaowu.zhang commented 2019-01-17 10:20:46 UTC
    Developer

    @Tyagov @jerome it seems you have work on this script from git history, can you pls check?

    Edited 2019-01-17 10:20:59 UTC
  • @Tyagov Ivan Tyagov
    @Tyagov commented 2019-01-17 10:36:56 UTC
    Developer

    @xiaowu.zhang , if I can imagine correctly this will introspect all object_view definitions and got "form_id" from there.

    Most likely it should be OK as long as object_view definitions keep expected standard (i.e. what you change and hard -code).

    I would try to use grep and find inside git if this is the case and if this is it no objects to merge in on my side.

  • @jerome Jérome Perrin
    @jerome commented 2019-01-17 10:51:42 UTC
    Owner

    Yes, this introspect portal type definition to make a report with one report section for each view of a document, and this part parses the URL to get the form id.

    It did not work when the action url had a "?=/"

    image

    this fix seems correct to me.

  • @jerome Jérome Perrin
    @jerome commented 2019-01-17 10:52:35 UTC
    Owner

    we cannot use urlparse module in restricted python ? this would be a more "beautiful" way than parsing url like this.

  • @jerome Jérome Perrin
    @jerome commented 2019-01-17 10:57:07 UTC
    Owner

    If I understand correctly an action like this

    string:${object_url}/Base_viewSomething?something=${here/getRelativeUrl}
    

    triggers the bug ( I did not find any in nexedi/erp5.git , but it really seems a bug in this script, no reason not to support such actions )

  • @xiaowu.zhang Xiaowu Zhang
    @xiaowu.zhang commented 2019-01-17 11:19:07 UTC
    Developer

    If I understand correctly an action like this

    string:${object_url}/Base_viewSomething?something=${here/getRelativeUrl}

    yes, in some other project we have.

    i find in nexedi/erp5.git, related document view

    for this view, the url is something like:

    https://erp5xxxx/document_module/7873/Document_viewRelated?cancel_url=https%3A//erp5xxxx/document_module/7873/File_view&object_uid=20154xxxxx&form_id=File_view&object_path=/nexedi/document_module/7873

    which cause problem when make a report

  • @xiaowu.zhang Xiaowu Zhang
    @xiaowu.zhang commented 2019-01-17 13:10:06 UTC
    Developer

    we cannot use urlparse module in restricted python ? this would be a more "beautiful" way than parsing url like this.

    no, i got error when access ParseResult's attribute

    Site Error
    An error was encountered while publishing this resource.
    
    Error Type: Unauthorized
    Error Value: You are not allowed to access 'path' in this context
    
    
    Edited 2019-01-17 13:11:13 UTC
  • @jerome Jérome Perrin
    @jerome commented 2019-01-18 04:32:48 UTC
    Owner

    Ah thanks for trying. I guess we can leave the urlparse refactoring for later.

    I see urlparse was allow_module'd in de2001ff but ParseResult ( there's also SplitResult or DefragResult) were not allowed. I doubt there's a security reason behind.

  • @xiaowu.zhang Xiaowu Zhang
    @xiaowu.zhang commented 2019-01-18 09:52:13 UTC
    Developer

    Most likely it should be OK as long as object_view definitions keep expected standard

    i check all object_view in erp5, it's all in string:${object_url}/form_viewSomething format

    so i think it's ok to merge

    anyway, i'll wait for my test result

  • @Tyagov Ivan Tyagov
    @Tyagov commented 2019-01-18 10:57:02 UTC
    Developer

    @xiaowu.zhang , thanks. Please merge if test passes.

  • @xiaowu.zhang Xiaowu Zhang
    @xiaowu.zhang

    mentioned in commit 96347a03

    2019-01-21 08:49:21 UTC

    mentioned in commit 96347a03

    Toggle commit list
  • @xiaowu.zhang Xiaowu Zhang
    @xiaowu.zhang

    merged

    2019-01-21 08:49:24 UTC

    merged

    Toggle commit list
  • @jerome Jérome Perrin
    @jerome

    mentioned in merge request !839

    2019-02-27 07:45:54 UTC

    mentioned in merge request !839

    Toggle commit list
  • Write
  • Preview
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
  • Please register or sign in to post a comment
Assignee
No assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
0
Labels
None
Assign labels
  • View labels
3
3 participants
Reference: nexedi/erp5!824
×

Revert this commit

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.
×

Cherry-pick this commit

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备14008524号