<commit_before><?php

    //sc/qa/edit.php
    include ('sc-app.inc');
    include(APP_WEB_DIR . '/inc/header.inc');
    include(APP_WEB_DIR . '/inc/role/user.inc');

    use com\indigloo\Util as Util;
    use com\indigloo\util\StringUtil as StringUtil;
    use com\indigloo\Url as Url;

    use com\indigloo\Constants as Constants;
    use com\indigloo\ui\form\Sticky;
    use com\indigloo\ui\SelectBox as SelectBox;

    use com\indigloo\ui\form\Message as FormMessage;
    use \com\indigloo\sc\auth\Login as Login ;
    use \com\indigloo\sc\util\PseudoId as PseudoId ;

    $sticky = new Sticky($gWeb->find(Constants::STICKY_MAP,true));
    //qUrl and fUrl
    $qUrl = Url::tryQueryParam("q");
    $qUrl = is_null($qUrl) ? '/' : $qUrl ;
    $fUrl = Url::current();

    $itemId = Url::getQueryParam("id");
    $postId = PseudoId::decode($itemId);

    $postDao = new \com\indigloo\sc\dao\Post();
    $postDBRow = $postDao->getOnId($postId);


    if(! (Login::isOwner($postDBRow['login_id']) || Login::isAdmin())) {
        header("Location: /qa/noowner.php");
        exit(1);
    }

    $loginId = Login::getLoginIdInSession() ;

    $strImagesJson = $sticky->get('images_json',$postDBRow['images_json']) ;
    $strLinksJson = $sticky->get('links_json',$postDBRow['links_json']) ;

    //@imp: we are enclosing the JSON string in single quotes
    //so the single quotes in string from DB should be escaped
    $strImagesJson = Util::formSafeJson($strImagesJson);
    $strLinksJson = Util::formSafeJson($strLinksJson);

    $groupDao = new \com\indigloo\sc\dao\Group();
    $group_names = $groupDao->slugToName($postDBRow['group_slug']);
<commit_msg>bug fix: display group names from slug using new method<commit_after><?php

    //sc/qa/edit.php
    include ('sc-app.inc');
    include(APP_WEB_DIR . '/inc/header.inc');
    include(APP_WEB_DIR . '/inc/role/user.inc');

    use com\indigloo\Util as Util;
    use com\indigloo\util\StringUtil as StringUtil;
    use com\indigloo\Url as Url;

    use com\indigloo\Constants as Constants;
    use com\indigloo\ui\form\Sticky;
    use com\indigloo\ui\SelectBox as SelectBox;

    use com\indigloo\ui\form\Message as FormMessage;
    use \com\indigloo\sc\auth\Login as Login ;
    use \com\indigloo\sc\util\PseudoId as PseudoId ;

    $sticky = new Sticky($gWeb->find(Constants::STICKY_MAP,true));
    //qUrl and fUrl
    $qUrl = Url::tryQueryParam("q");
    $qUrl = is_null($qUrl) ? '/' : $qUrl ;
    $fUrl = Url::current();

    $itemId = Url::getQueryParam("id");
    $postId = PseudoId::decode($itemId);

    $postDao = new \com\indigloo\sc\dao\Post();
    $postDBRow = $postDao->getOnId($postId);


    if(! (Login::isOwner($postDBRow['login_id']) || Login::isAdmin())) {
        header("Location: /qa/noowner.php");
        exit(1);
    }

    $loginId = Login::getLoginIdInSession() ;

    $strImagesJson = $sticky->get('images_json',$postDBRow['images_json']) ;
    $strLinksJson = $sticky->get('links_json',$postDBRow['links_json']) ;

    //@imp: we are enclosing the JSON string in single quotes
    //so the single quotes in string from DB should be escaped
    $strImagesJson = Util::formSafeJson($strImagesJson);
    $strLinksJson = Util::formSafeJson($strLinksJson);

    $groupDao = new \com\indigloo\sc\dao\Group();
    $group_names = $groupDao->tokenizeSlug($postDBRow['group_slug'],",",true);

{'fraction_non_alphanumeric': 0.16354445435622955, 'fraction_numerical': 0.0005947071067499256, 'mean_word_length': 3.521505376344086, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7412850', 'n_tokens_mistral': 1249, 'n_tokens_neox': 1221, 'n_words': 221}