View | Details | Raw Unified | Return to bug 22278
Collapse All | Expand All

(-)a/reports/guided_reports.pl (-4 / +6 lines)
Lines 600-606 elsif ( $phase eq 'Save Report' ) { Link Here
600
    }
600
    }
601
601
602
    create_non_existing_group_and_subgroup($input, $group, $subgroup);
602
    create_non_existing_group_and_subgroup($input, $group, $subgroup);
603
604
    ## FIXME this is AFTER entering a name to save the report under
603
    ## FIXME this is AFTER entering a name to save the report under
605
    if ($sql =~ /;?\W?(UPDATE|DELETE|DROP|INSERT|SHOW|CREATE)\W/i) {
604
    if ($sql =~ /;?\W?(UPDATE|DELETE|DROP|INSERT|SHOW|CREATE)\W/i) {
606
        push @errors, {sqlerr => $1};
605
        push @errors, {sqlerr => $1};
Lines 659-665 elsif ( $phase eq 'Save Report' ) { Link Here
659
                    cache_expiry   => $cache_expiry,
658
                    cache_expiry   => $cache_expiry,
660
                    public         => $public,
659
                    public         => $public,
661
                } );
660
                } );
662
663
                logaction( "REPORTS", "ADD", $id, "$name | $sql" ) if C4::Context->preference("ReportsLog");
661
                logaction( "REPORTS", "ADD", $id, "$name | $sql" ) if C4::Context->preference("ReportsLog");
664
            $template->param(
662
            $template->param(
665
                'save_successful' => 1,
663
                'save_successful' => 1,
Lines 1058-1064 sub groups_with_subgroups { Link Here
1058
1056
1059
sub create_non_existing_group_and_subgroup {
1057
sub create_non_existing_group_and_subgroup {
1060
    my ($input, $group, $subgroup) = @_;
1058
    my ($input, $group, $subgroup) = @_;
1061
1062
    if (defined $group and $group ne '') {
1059
    if (defined $group and $group ne '') {
1063
        my $report_groups = C4::Reports::Guided::get_report_groups;
1060
        my $report_groups = C4::Reports::Guided::get_report_groups;
1064
        if (not exists $report_groups->{$group}) {
1061
        if (not exists $report_groups->{$group}) {
Lines 1068-1073 sub create_non_existing_group_and_subgroup { Link Here
1068
                authorised_value => $group,
1065
                authorised_value => $group,
1069
                lib => $groupdesc,
1066
                lib => $groupdesc,
1070
            })->store;
1067
            })->store;
1068
            my $cache_key = "AuthorisedValues-REPORT_GROUP-0-".C4::Context->userenv->{"branch"};
1069
            my $cache  = Koha::Caches->get_instance();
1070
            my $result = $cache->clear_from_cache($cache_key);
1071
        }
1071
        }
1072
        if (defined $subgroup and $subgroup ne '') {
1072
        if (defined $subgroup and $subgroup ne '') {
1073
            if (not exists $report_groups->{$group}->{subgroups}->{$subgroup}) {
1073
            if (not exists $report_groups->{$group}->{subgroups}->{$subgroup}) {
Lines 1078-1083 sub create_non_existing_group_and_subgroup { Link Here
1078
                    lib => $subgroupdesc,
1078
                    lib => $subgroupdesc,
1079
                    lib_opac => $group,
1079
                    lib_opac => $group,
1080
                })->store;
1080
                })->store;
1081
            my $cache_key = "AuthorisedValues-REPORT_SUBGROUP-0-".C4::Context->userenv->{"branch"};
1082
            my $cache  = Koha::Caches->get_instance();
1083
            my $result = $cache->clear_from_cache($cache_key);
1081
            }
1084
            }
1082
        }
1085
        }
1083
    }
1086
    }
1084
- 

Return to bug 22278