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

Links are broken in dynamic blocks when the task has the cookies [/] or [%] #248

Closed
maikol-solis opened this issue Aug 25, 2021 · 8 comments

Comments

@maikol-solis
Copy link

According to the org-mode docs (https://orgmode.org/manual/Breaking-Down-Tasks.html) we can add cookies to split tasks into subtasks.

However, the dynamic block broke the links for all the tasks having these cookies, because it adds the information of the cookie within the link.

In the example below, in the dynamic block, if you click in the Task 1, it doesn't go to anywhere because the right link should be [[Task 1][Task 1​]]

#+BEGIN: org-ql :query (and (planning :from "2021-08-21" :to "2021-08-30") (todo)) :columns (todo (priority "P") deadline heading)  :ts-format "%Y-%m-%d %H:%M"
| Todo | P | Deadline         | Heading                          |
|------+---+------------------+----------------------------------|
| TODO | B | 2021-08-23 00:00 | [[Task 1 \[1/2\]][Task 1 [1/2]​]] |
| TODO |   | 2021-08-27 00:00 | [[Subtask 2][Subtask 2]]         |
| TODO | A | 2021-08-27 00:00 | [[Task 2][Task 2]]               |
#+END:

* TODO [#B] Task 1 [1/2]
DEADLINE: <2021-08-23 Mon>
** DONE Subtask 1
DEADLINE: <2021-08-24 Tue>
** TODO Subtask 2
DEADLINE: <2021-08-27 Fri>
* TODO [#A] Task 2
DEADLINE: <2021-08-27 Fri>

Thanks.

@alphapapa alphapapa self-assigned this Aug 25, 2021
@alphapapa alphapapa added the bug label Aug 25, 2021
@alphapapa
Copy link
Owner

Oops, I hadn't noticed that. Thanks.

I'll get to this, but I have some other things going on too, and it shouldn't be too hard of a fix, so I'll tag this as "help wanted" and such, in case anyone else would like to pitch in. :)

maikol-solis added a commit to maikol-solis/org-ql that referenced this issue Aug 25, 2021
This fixes the issue alphapapa#248 by using `:title` instead of `:raw-values` and taking the first element. 

I am not sure if this will work in all the cases but in my test is good enough.
maikol-solis added a commit to maikol-solis/org-ql that referenced this issue Aug 25, 2021
…adings

Fixes alphapapa#248 

Uses `:title` instead of `raw-value` combined with a `car` to capture only the title of the heading. 
Now the links are properly formed even if there exist cookies (`[/]` or `[%]`).
maikol-solis added a commit to maikol-solis/org-ql that referenced this issue Aug 27, 2021
Fix alphapapa#248

Giving this edge case (alphapapa#249 (comment)) the use of `:title` could be not optimal. 

This commit uses a regexp to remove the cookie directly.
maikol-solis added a commit to maikol-solis/org-ql that referenced this issue Aug 30, 2021
@novoid
Copy link

novoid commented Feb 21, 2022

Is there a workaround where I get id:foo (with the appropiate :PROPERTY: id) in a column of the dynamic table?

Currently, all of my projects do have progress indicator cookies and therefore I can't use org-ql for generating my project overview and jump table ...

@alphapapa
Copy link
Owner

@maikol-solis @novoid A simple test shows that it seems to be fixed now. Please let me know if it works for you. Thanks.

@novoid
Copy link

novoid commented Mar 1, 2022

My current org-ql-20210922.615 from MELPA does not fix the issue and no update is pending at the moment. I'll schedule a task to re-evaluate and come back here later.

@alphapapa
Copy link
Owner

Yes, it won't be fixed on MELPA until the package is rebuilt.

@maikol-solis
Copy link
Author

@maikol-solis @novoid A simple test shows that it seems to be fixed now. Please let me know if it works for you. Thanks.

Glad to help!

@novoid
Copy link

novoid commented Mar 10, 2022

Today I updated my Elpa packages and got org-ql-20220301.841 which fixed the issue. This is very much welcomed as the last step to get rid of (very very slow) default dynamic tables for a project overview by switching to fast and elegant org-ql. Thank you! 🙇

alphapapa added a commit that referenced this issue Mar 18, 2022
Fixes #248.  Closes #249.

Thanks to Maikol Solis (@maikol-solis) for reporting, and to him and
Ihor Radchenko (@yantar92) for helping plan the fix.
@alphapapa
Copy link
Owner

Rebased this fix into 0.6.1 stable release rather than 0.7-pre.

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

Successfully merging a pull request may close this issue.

3 participants