How do the project cookies work?

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
Joselyne
Posts: 70
Joined: 14 Dec 2023, 15:59

How do the project cookies work?

Post by Joselyne »

Hello,

I've use the following to rename $s_submit_report_button for one of the projects.

$t_cookie_name = config_get_global( 'project_cookie' );
if ( $_COOKIE[$t_cookie_name] ){
$t_project_id = $_COOKIE[$t_cookie_name];
//if ($t_project_id === '11'){
if ($t_project_id === '7'){
$s_submit_report_button = 'Submit new ticket';
}else{
$s_submit_report_button = 'Create draft';
}
}

But sometimes, the string is not translated and shows "Submit new issue " as described in /lang/english.txt.

I would like to understand how project 's cookies work.

Thanks.
atrol
Site Admin
Posts: 8555
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: How do the project cookies work?

Post by atrol »

You can use function helper_get_current_project for that.
See core/helper_api.php

Code: Select all

/**
 * Return the current project id as stored in a cookie
 * If no cookie exists, the user's default project is returned
 * @return integer
 */
Please use Search before posting and read the Manual
Post Reply