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

ENH Add link method to BuildTask #9899

Open
wants to merge 1 commit into
base: 4
Choose a base branch
from

Conversation

sunnysideup
Copy link
Contributor

This makes it easier to access dev/tasks from various places in, for example, the CMS.

In further commits, this can also be used in other places so that there is one source of truth for the link for a BuildTask.

This makes it easier to access dev/tasks from various places in, for example, the CMS.  

In further commits, this can also be used in other places so that there is one source of truth for the link for a BuildTask.
*/
public function Link() : string
{
$link = $this->Config()->get('segment');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$link = $this->Config()->get('segment');
$link = $this->config()->get('segment');

if (! $link) {
$link = str_replace('\\', '-', static::class);
}
return Director::absoluteUrl('dev/tasks/') . $link;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the dev/ and tasks/ portions are, in theory, configurable via SilverStripe\Dev\DevelopmentAdmin::registered_controllers so I'm not sure we should be hardcoding it here. To be fair on the other site I haven't seen anyone ever change it.

There might be a way how to get the action (and its url) from the SilverStripe\Dev\TaskRunner controller, using/including the task name.

@michalkleiner michalkleiner changed the title MINOR: adding link to BuildTask ENH Add link method to BuildTask Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants