[Mahara-contributors] [Bug 1519989] Re: Refactor duplicate collections access code in index.php & index.json.php
** Tags removed: code-cleanup ** Tags added: refactoring -- You received this bug notification because you are a member of Mahara Contributors, which is subscribed to Mahara. Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it! https://bugs.launchpad.net/bugs/1519989 Title: Refactor duplicate collections access code in index.php & index.json.php Status in Mahara: Confirmed Bug description: After patch https://reviews.mahara.org/#/c/5695/6 for Bug1514374, we've now got duplicate code it htdocs/collection/index.php and htdocs/collection/index.json.php, for checking whether the user has access to the particular collections they're trying to look at. This kind of duplication stands a high likelihood of falling out of sync if changes are made to the access code in the future, so we should abstract it out into a common access method that gets called by both scripts. The code is not *exactly* the same in both places. index.php intersperses it with code to set the menu headers, and index.json.php sends an error via json_reply on failure, while index.php throws an AccessDeniedException(). So it will require a little bit of thinking to do it. But it's not impossible. To manage notifications about this bug go to: https://bugs.launchpad.net/mahara/+bug/1519989/+subscriptions ___ Mailing list: https://launchpad.net/~mahara-contributors Post to : mahara-contributors@lists.launchpad.net Unsubscribe : https://launchpad.net/~mahara-contributors More help : https://help.launchpad.net/ListHelp
[Mahara-contributors] [Bug 1519989] Re: Refactor duplicate collections access code in index.php & index.json.php
When tackling that, it should be looked at whether we can set coding standards / guidelines when we have a json.php and a .php file so we don't end up in a situation like this again. ** Tags added: code-cleanup ** Changed in: mahara Milestone: 18.10.0 => None -- You received this bug notification because you are a member of Mahara Contributors, which is subscribed to Mahara. Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it! https://bugs.launchpad.net/bugs/1519989 Title: Refactor duplicate collections access code in index.php & index.json.php Status in Mahara: Confirmed Bug description: After patch https://reviews.mahara.org/#/c/5695/6 for Bug1514374, we've now got duplicate code it htdocs/collection/index.php and htdocs/collection/index.json.php, for checking whether the user has access to the particular collections they're trying to look at. This kind of duplication stands a high likelihood of falling out of sync if changes are made to the access code in the future, so we should abstract it out into a common access method that gets called by both scripts. The code is not *exactly* the same in both places. index.php intersperses it with code to set the menu headers, and index.json.php sends an error via json_reply on failure, while index.php throws an AccessDeniedException(). So it will require a little bit of thinking to do it. But it's not impossible. To manage notifications about this bug go to: https://bugs.launchpad.net/mahara/+bug/1519989/+subscriptions ___ Mailing list: https://launchpad.net/~mahara-contributors Post to : mahara-contributors@lists.launchpad.net Unsubscribe : https://launchpad.net/~mahara-contributors More help : https://help.launchpad.net/ListHelp
[Mahara-contributors] [Bug 1519989] Re: Refactor duplicate collections access code in index.php & index.json.php
** Changed in: mahara Milestone: 18.04.0 => 18.10.0 -- You received this bug notification because you are a member of Mahara Contributors, which is subscribed to Mahara. Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it! https://bugs.launchpad.net/bugs/1519989 Title: Refactor duplicate collections access code in index.php & index.json.php Status in Mahara: Confirmed Bug description: After patch https://reviews.mahara.org/#/c/5695/6 for Bug1514374, we've now got duplicate code it htdocs/collection/index.php and htdocs/collection/index.json.php, for checking whether the user has access to the particular collections they're trying to look at. This kind of duplication stands a high likelihood of falling out of sync if changes are made to the access code in the future, so we should abstract it out into a common access method that gets called by both scripts. The code is not *exactly* the same in both places. index.php intersperses it with code to set the menu headers, and index.json.php sends an error via json_reply on failure, while index.php throws an AccessDeniedException(). So it will require a little bit of thinking to do it. But it's not impossible. To manage notifications about this bug go to: https://bugs.launchpad.net/mahara/+bug/1519989/+subscriptions ___ Mailing list: https://launchpad.net/~mahara-contributors Post to : mahara-contributors@lists.launchpad.net Unsubscribe : https://launchpad.net/~mahara-contributors More help : https://help.launchpad.net/ListHelp
[Mahara-contributors] [Bug 1519989] Re: Refactor duplicate collections access code in index.php & index.json.php
** Changed in: mahara Milestone: 17.10.0 => 18.04.0 -- You received this bug notification because you are a member of Mahara Contributors, which is subscribed to Mahara. Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it! https://bugs.launchpad.net/bugs/1519989 Title: Refactor duplicate collections access code in index.php & index.json.php Status in Mahara: Confirmed Bug description: After patch https://reviews.mahara.org/#/c/5695/6 for Bug1514374, we've now got duplicate code it htdocs/collection/index.php and htdocs/collection/index.json.php, for checking whether the user has access to the particular collections they're trying to look at. This kind of duplication stands a high likelihood of falling out of sync if changes are made to the access code in the future, so we should abstract it out into a common access method that gets called by both scripts. The code is not *exactly* the same in both places. index.php intersperses it with code to set the menu headers, and index.json.php sends an error via json_reply on failure, while index.php throws an AccessDeniedException(). So it will require a little bit of thinking to do it. But it's not impossible. To manage notifications about this bug go to: https://bugs.launchpad.net/mahara/+bug/1519989/+subscriptions ___ Mailing list: https://launchpad.net/~mahara-contributors Post to : mahara-contributors@lists.launchpad.net Unsubscribe : https://launchpad.net/~mahara-contributors More help : https://help.launchpad.net/ListHelp
[Mahara-contributors] [Bug 1519989] Re: Refactor duplicate collections access code in index.php & index.json.php
** Changed in: mahara Milestone: 17.04.0 => 17.10.0 -- You received this bug notification because you are a member of Mahara Contributors, which is subscribed to Mahara. Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it! https://bugs.launchpad.net/bugs/1519989 Title: Refactor duplicate collections access code in index.php & index.json.php Status in Mahara: Confirmed Bug description: After patch https://reviews.mahara.org/#/c/5695/6 for Bug1514374, we've now got duplicate code it htdocs/collection/index.php and htdocs/collection/index.json.php, for checking whether the user has access to the particular collections they're trying to look at. This kind of duplication stands a high likelihood of falling out of sync if changes are made to the access code in the future, so we should abstract it out into a common access method that gets called by both scripts. The code is not *exactly* the same in both places. index.php intersperses it with code to set the menu headers, and index.json.php sends an error via json_reply on failure, while index.php throws an AccessDeniedException(). So it will require a little bit of thinking to do it. But it's not impossible. To manage notifications about this bug go to: https://bugs.launchpad.net/mahara/+bug/1519989/+subscriptions ___ Mailing list: https://launchpad.net/~mahara-contributors Post to : mahara-contributors@lists.launchpad.net Unsubscribe : https://launchpad.net/~mahara-contributors More help : https://help.launchpad.net/ListHelp
[Mahara-contributors] [Bug 1519989] Re: Refactor duplicate collections access code in index.php & index.json.php
** Changed in: mahara Milestone: 16.10.1 => 17.04.0 -- You received this bug notification because you are a member of Mahara Contributors, which is subscribed to Mahara. Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it! https://bugs.launchpad.net/bugs/1519989 Title: Refactor duplicate collections access code in index.php & index.json.php Status in Mahara: Confirmed Bug description: After patch https://reviews.mahara.org/#/c/5695/6 for Bug1514374, we've now got duplicate code it htdocs/collection/index.php and htdocs/collection/index.json.php, for checking whether the user has access to the particular collections they're trying to look at. This kind of duplication stands a high likelihood of falling out of sync if changes are made to the access code in the future, so we should abstract it out into a common access method that gets called by both scripts. The code is not *exactly* the same in both places. index.php intersperses it with code to set the menu headers, and index.json.php sends an error via json_reply on failure, while index.php throws an AccessDeniedException(). So it will require a little bit of thinking to do it. But it's not impossible. To manage notifications about this bug go to: https://bugs.launchpad.net/mahara/+bug/1519989/+subscriptions ___ Mailing list: https://launchpad.net/~mahara-contributors Post to : mahara-contributors@lists.launchpad.net Unsubscribe : https://launchpad.net/~mahara-contributors More help : https://help.launchpad.net/ListHelp
[Mahara-contributors] [Bug 1519989] Re: Refactor duplicate collections access code in index.php & index.json.php
** Changed in: mahara Milestone: 16.10.0 => 16.10.1 -- You received this bug notification because you are a member of Mahara Contributors, which is subscribed to Mahara. Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it! https://bugs.launchpad.net/bugs/1519989 Title: Refactor duplicate collections access code in index.php & index.json.php Status in Mahara: Confirmed Bug description: After patch https://reviews.mahara.org/#/c/5695/6 for Bug1514374, we've now got duplicate code it htdocs/collection/index.php and htdocs/collection/index.json.php, for checking whether the user has access to the particular collections they're trying to look at. This kind of duplication stands a high likelihood of falling out of sync if changes are made to the access code in the future, so we should abstract it out into a common access method that gets called by both scripts. The code is not *exactly* the same in both places. index.php intersperses it with code to set the menu headers, and index.json.php sends an error via json_reply on failure, while index.php throws an AccessDeniedException(). So it will require a little bit of thinking to do it. But it's not impossible. To manage notifications about this bug go to: https://bugs.launchpad.net/mahara/+bug/1519989/+subscriptions ___ Mailing list: https://launchpad.net/~mahara-contributors Post to : mahara-contributors@lists.launchpad.net Unsubscribe : https://launchpad.net/~mahara-contributors More help : https://help.launchpad.net/ListHelp
[Mahara-contributors] [Bug 1519989] Re: Refactor duplicate collections access code in index.php & index.json.php
** Changed in: mahara Milestone: 16.04.0 => 16.10.0 -- You received this bug notification because you are a member of Mahara Contributors, which is subscribed to Mahara. Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it! https://bugs.launchpad.net/bugs/1519989 Title: Refactor duplicate collections access code in index.php & index.json.php Status in Mahara: Confirmed Bug description: After patch https://reviews.mahara.org/#/c/5695/6 for Bug1514374, we've now got duplicate code it htdocs/collection/index.php and htdocs/collection/index.json.php, for checking whether the user has access to the particular collections they're trying to look at. This kind of duplication stands a high likelihood of falling out of sync if changes are made to the access code in the future, so we should abstract it out into a common access method that gets called by both scripts. The code is not *exactly* the same in both places. index.php intersperses it with code to set the menu headers, and index.json.php sends an error via json_reply on failure, while index.php throws an AccessDeniedException(). So it will require a little bit of thinking to do it. But it's not impossible. To manage notifications about this bug go to: https://bugs.launchpad.net/mahara/+bug/1519989/+subscriptions ___ Mailing list: https://launchpad.net/~mahara-contributors Post to : mahara-contributors@lists.launchpad.net Unsubscribe : https://launchpad.net/~mahara-contributors More help : https://help.launchpad.net/ListHelp