Moodle
  1. Moodle
  2. MDL-10708

Database - Viewable from-to is not working

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.8.2
    • Fix Version/s: None
    • Labels:
    • Environment:
      MySQL 5.0.40
      PHP 5.2.2
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_18_STABLE
    • Rank:
      306

      Description

      Viewable from-to, the settings shows no reaction, i see a topic in forum here on moodle.org http://moodle.org/mod/forum/discuss.php?d=56412 they have the same problem.

      Andy

      1. moodle19_data_dates_v2.patch
        6 kB
        Steve Bond
      2. moodle19_data_dates.patch
        6 kB
        Ashley Holman

        Activity

        Hide
        Andy Tagliani added a comment -

        More than 6 month ago, i hope i can to demand, is there any solution or not? I check it out in the newest version 1.8.4 and 1.9, the bug or problem is already exist! The PHP-Version is change to 5.2.5

        Andy

        Show
        Andy Tagliani added a comment - More than 6 month ago, i hope i can to demand, is there any solution or not? I check it out in the newest version 1.8.4 and 1.9, the bug or problem is already exist! The PHP-Version is change to 5.2.5 Andy
        Hide
        Ashley Holman added a comment -

        Here's a patch which implements the available/viewable dates for 1.9 and should work on 1.8 too. To apply it:

        cd <moodle-base-dir>
        patch -p0 < moodle19_data_dates.patch

        The dates have been implemented like this:

        • "Viewable" dates control when the entire activity can be viewed. If a user tries to access the activity outside of the viewable date range, they will get a message displaying the viewable from/to dates and will not be able to view or add/edit records.
        • "Available for submission" dates control when records can be added/edited. If the database is accessed when it is not available, records can be viewed and comments can be made, but no adds/edits are permitted.

        Note: This patch adds an if() block around some existing code but doesn't indent it, in order to keep the patch file simple and not add a big block of indented lines. If someone wants to commit this, the indentation should be fixed up.

        Cheers
        Ashley.

        Show
        Ashley Holman added a comment - Here's a patch which implements the available/viewable dates for 1.9 and should work on 1.8 too. To apply it: cd <moodle-base-dir> patch -p0 < moodle19_data_dates.patch The dates have been implemented like this: "Viewable" dates control when the entire activity can be viewed. If a user tries to access the activity outside of the viewable date range, they will get a message displaying the viewable from/to dates and will not be able to view or add/edit records. "Available for submission" dates control when records can be added/edited. If the database is accessed when it is not available, records can be viewed and comments can be made, but no adds/edits are permitted. Note: This patch adds an if() block around some existing code but doesn't indent it, in order to keep the patch file simple and not add a big block of indented lines. If someone wants to commit this, the indentation should be fixed up. Cheers Ashley.
        Hide
        Antonio Piedras Morente added a comment -

        This patch works fine, but the dates "Viewable" and "Available for submission" affects editing teacher too.
        To solve this, we can add this in the patch:
        Changes:
        file: /mod/data/view.php
        line: if (!$viewable) {
        for: if (!$viewable and !has_capability('moodle/legacy:editingteacher', $context)) {

        file: /mod/data/edit.php
        line: if (!data_isavailable($data)) {
        for: if (!data_isavailable($data) and !has_capability('moodle/legacy:editingteacher', $context)) {

        Cheers
        Antonio

        Show
        Antonio Piedras Morente added a comment - This patch works fine, but the dates "Viewable" and "Available for submission" affects editing teacher too. To solve this, we can add this in the patch: Changes: file: /mod/data/view.php line: if (!$viewable) { for: if (!$viewable and !has_capability('moodle/legacy:editingteacher', $context)) { file: /mod/data/edit.php line: if (!data_isavailable($data)) { for: if (!data_isavailable($data) and !has_capability('moodle/legacy:editingteacher', $context)) { Cheers Antonio
        Hide
        Petr Škoda added a comment -

        hello Robert,
        if you find some time could you please evaluate this?

        Show
        Petr Škoda added a comment - hello Robert, if you find some time could you please evaluate this?
        Hide
        Ashley Holman added a comment -

        Hi Petr,

        I think this should be OK to commit (along with Antonio's change). I developed this for a university here in Adelaide and they've been using it for a semester and it's working well for them.

        Cheers
        Ashley

        Show
        Ashley Holman added a comment - Hi Petr, I think this should be OK to commit (along with Antonio's change). I developed this for a university here in Adelaide and they've been using it for a semester and it's working well for them. Cheers Ashley
        Hide
        Steve Bond added a comment -

        I have incorporated Antonio's corrections into the patch and reposted it here for others' convenience.

        Show
        Steve Bond added a comment - I have incorporated Antonio's corrections into the patch and reposted it here for others' convenience.
        Hide
        Helen Foster added a comment -

        This issue is again being discussed in the forums http://moodle.org/mod/forum/discuss.php?d=127873

        Adding a fix version in the hope that the issue can be resolved soon.

        Show
        Helen Foster added a comment - This issue is again being discussed in the forums http://moodle.org/mod/forum/discuss.php?d=127873 Adding a fix version in the hope that the issue can be resolved soon.
        Hide
        Petr Škoda added a comment -

        I am afraid this will have to wait till 2.0, new features and significant changes in 1.9.x are not expected, sorry

        Please do not use legacy caps at all in new code ('moodle/legacy:editingteacher')

        Show
        Petr Škoda added a comment - I am afraid this will have to wait till 2.0, new features and significant changes in 1.9.x are not expected, sorry Please do not use legacy caps at all in new code ('moodle/legacy:editingteacher')
        Hide
        Steve Bond added a comment -

        This is effectively fixed in 2.0 via a change in the terminology and functionality. What was "viewable from/to" is now "read-only from/to". Combining this with the "available from/to" settings and you can achieve the necessary control over availability of the database.

        I have updated Moodle docs to clarify how it works:
        http://docs.moodle.org/20/en/Database_settings#Available_from.2Fto

        Show
        Steve Bond added a comment - This is effectively fixed in 2.0 via a change in the terminology and functionality. What was "viewable from/to" is now "read-only from/to". Combining this with the "available from/to" settings and you can achieve the necessary control over availability of the database. I have updated Moodle docs to clarify how it works: http://docs.moodle.org/20/en/Database_settings#Available_from.2Fto
        Hide
        Michael de Raadt added a comment -

        Thanks for reporting this issue.

        We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.

        If you believe that this issue is still relevant to current versions (2.3 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

        Michael d;

        4d6f6f646c6521

        Show
        Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.3 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d; 4d6f6f646c6521
        Hide
        Michael de Raadt added a comment -

        I'm closing this issue as it has been inactive for over a year has been recorded as affecting versions that are no longer supported.

        If you still believe this is an issue in supported versions, please report a new issue.

        Show
        Michael de Raadt added a comment - I'm closing this issue as it has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you still believe this is an issue in supported versions, please report a new issue.

          People

          • Votes:
            12 Vote for this issue
            Watchers:
            12 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: