moodle-local_pages's Issues
Coding error detected when viewing a page with child form page
Attempting to view a page that has a form page associated as a child, throws the following fatal error:
Coding error detected, it must be fixed by a programmer: optional_param requires $parname, $default + $type to be specified (parameter: )
Debug info:
Error code: codingerror
Stack trace:
line 644 of /lib/moodlelib.php: coding_exception thrown
line 236 of /local/pages/renderer.php: call to optional_param()
line 153 of /local/pages/renderer.php: call to local_pages_renderer->createform()
line 78 of /local/pages/index.php: call to local_pages_renderer->showpage()
Boost Navigation Block
Pages checked to show on Menu do not show in the latest Boost Navigation Block.
Invalid get_string() identifier: 'cachedef_sent'
Hello,
local_pages v1.7 (2019011107)
Doing some testing with Moodle v3.8.1 and I'm recieving this error when on the Cache administration page. I'm not noticing any functional problems with the plugin.
I know your latest supported version for this plugin is v3.7, but I thought it would be good to report the issue to you. Any thoughts or ideas for fixing this?
Invalid get_string() identifier: 'cachedef_sent' or component 'local_pages'. Perhaps you are missing $string['cachedef_sent'] = ''; in /var/www/html/moodle/local/pages/lang/en/local_pages.php? line 353 of /lib/classes/string_manager_standard.php: call to debugging() line 10283 of /lib/moodlelib.php: call to core_string_manager_standard->get_string() line 10317 of /lib/moodlelib.php: call to lang_string->get_string() line ? of unknownfile: call to lang_string->__toString() line 212 of /lib/classes/collator.php: call to Collator->asort() line 322 of /lib/classes/collator.php: call to core_collator::asort() line 246 of /cache/renderer.php: call to core_collator::asort_array_of_arrays_by_key() line 316 of /cache/admin.php: call to core_cache_renderer->definition_summaries()
mysql specific functions
Hi there,
I've just had an initial look at this to consider approval in the plugins db.
UNIX_TIMESTAMP is a mysql specific function - this will not work in other supported databases:
https://github.com/learningworks/moodle-local_pages/blob/master/lib.php#L74
Checking for capability
There is no point of calling
if (!has_capability('local/pages:addpages', $context)) {
require_capability('local/pages:addpages', $context);
}
All you need is just require_capability()
call, right?
Translation #2
Sorry about this new issue but one word is missing:
In Form Builder "Type" is hardcoded.
Once again, SORRY and THANKS for the plugin.
textarea message x local page
Hello,
I will describe the problem encountered when using the plugin
Moodle : Moodle 3.11.3+ (Build: 20211013)
Version local/pages: v1.9 (2021110400)
After more than 2 hours checking additional css to try to find the error i found out it was the pages plugin.
when I access the message page : http://localhost/moodle/message/index.php
the send messages text box has been resized
see
with plugin PAGES :
would there be any additional css that I could put in the field?
Thank you
Typo in the short description at moodle.org/plugins
"avaialbe" should read "available"
Required parameter $gnav follows optional parameter $parent
Installing the plugin on Moodle 3.11 with PHP 8.0 and debugging enabled shows the warning:
Deprecated: Required parameter $gnav follows optional parameter $parent in /var/www/moodle/local/pages/lib.php on line 102
Orphaned Boost Navbar item
It appears I've ended up with an orphaned item on the bottom of the navbar in Boost which I think was added by local_pages, The item is simply called 'Pages plugin' and I suspect it's from where the local_pages plugin was previously installed a page created with 'Display on menu' ticked and then the page was deleted and/or the plugin was uninstalled. Can't seem to get rid of it.
If I uninstall the local_pages plugin it goes away, as soon as I re-install it comes back.
Best wishes
Neil
missing sesskey checks on actions
https://github.com/learningworks/moodle-local_pages/blob/master/pages/pages.php#L45
this should really have a sesskey check as well - more info:
https://docs.moodle.org/dev/Security:Cross-site_request_forgery
Unable to save the form in PostgreSQL
Attempting to save a form in PostgreSQL leads to error:
Error reading from database
Debug info: ERROR: operator does not exist: text = integer
LINE 1: ...LECT COUNT(1) FROM mdl_local_pageslogging WHERE formname = 2
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
SELECT COUNT(1) FROM mdl_local_pageslogging WHERE formname = 2
[array (
)]
Error code: dmlreadexception
Stack trace:
line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown
line 242 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
line 776 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
line 1558 of /lib/dml/moodle_database.php: call to pgsql_native_moodle_database->get_records_sql()
line 1631 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
line 1841 of /lib/dml/moodle_database.php: call to moodle_database->get_field_sql()
line 1576 of /lib/tablelib.php: call to moodle_database->count_records_sql()
line 1630 of /lib/tablelib.php: call to table_sql->query_db()
line 85 of /local/pages/pages/edit.php: call to table_sql->out()
Getting undefined method hideIf
Exception - Call to undefined method MoodleQuickForm::hideIf()
Debug info:
Error code: generalexceptionmessage
Stack trace:
line 165 of /local/pages/forms/edit.php: Error thrown
line 194 of /lib/formslib.php: call to pages_edit_product_form->definition()
line 57 of /local/pages/forms/edit.php: call to moodleform->__construct()
line 410 of /local/pages/renderer.php: call to pages_edit_product_form->__construct()
line 56 of /local/pages/edit.php: call to local_pages_renderer->save_page()
all pages are accessible anonymously.
this appears to be by design:
https://github.com/learningworks/moodle-local_pages/blob/master/index.php#L37
but there is no mention of this in the description/docs of the plugin.
If pages are really supposed to be accessbile anonymously - this should be made very clear in the readme and in the description of your plugin in the plugins db.
Why does it need to use the PHP native mail() function?
I am wondering what is the use case for using the direct low level access to the PHP's mail()
function via the custom_email
setting. As far as I can see, it only exposes the plugin to a wide range of various security risks including SMTP header injection, spam risk etc. Is that really needed?
Child pages cannot be viewed if parent is deleted
When parent page is removed - update Admin navigation when viewing pages list to show orphaned pages.
Tricky access to session superglobal
The code like this:
$_SESSION[$data->pagename] = "sent";
is not quite right:
- The user could mistakenly overwrite some existing session value if it collides with the page name.
- It uses the session superglobal directly.
if you need to access the session, you should use the global $SESSION
wrapper or (maybe even better) have a dedicated session cache defined -
https://docs.moodle.org/dev/The_Moodle_Universal_Cache_(MUC)#Session_cache
Invalid page layout specified
The following error is displayed when viewing a page
Invalid page layout specified: map
line 2463 of /lib/outputlib.php: call to debugging()
line 2480 of /lib/outputlib.php: call to theme_config->layout_info_for_page()
line 1298 of /lib/outputrenderers.php: call to theme_config->layout_file()
line 74 of /local/pages/index.php: call to core_renderer->header()
To remedy change line 47 in index.php from $PAGE->set_pagelayout($templatename);
to
$PAGE->set_pagelayout('standard');
optionally create a special template for pages.
Exception - count(): Argument #1 ($value) must be of type Countable|array, null given
Exception - count(): Argument #1 ($value) must be of type Countable|array, null given
Getting this error after installation of plugin. Moodle 3.11 with Klassroom theme. Error is produced after Clicking on Pages Plugin in the Navigation block , then clicking add page.
Feature Request: Capabilities
L.s.
Is it possible to ad rights on system level to users to edit the pages and/or add pages?
Bert
In moodle
L.s.
In Moodle 3.5.2+ (Build: 20181103) the breadcrumb is not visible on the local page. Tested it in different themes.
Bert
Redirecting after HTTP output
When saving a new page, I get
You should really redirect before you start page output
line 1019 of /lib/outputrenderers.php: call to debugging()
line 2830 of /lib/weblib.php: call to core_renderer->redirect_message()
line 470 of /local/pages/renderer.php: call to redirect()
line 82 of /local/pages/pages/edit.php: call to local_pages_renderer->edit_page()
direct access of $_POST not usually allowed
Typically direct access to $_POST/$_GET results in a failed review for inclusion in the plugins db and optional/required_param must be used - I haven't looked closely but you might possibly have some valid reasons for using $_POST - it's just really hard to read the code:
moodle-local_pages/renderer.php
Line 193 in 00423b3
If you really need to access $_POST directly I'd suggest you do it in a way that is much easier to review in your code, and see that you are sanitising the data correctly, possibly adding some code comments that justify why you can't use optional/required_param and we can review that a bit easier. This will also come up when other organisations perform a review on your code, so if you can rewrite it to use optional/required_param it will make it much easier for other organisations to use your plugin.
Travis CI Moodle 3.5+
Hey Kevin,
I see that your Travis runs are failing on tests running on PHP 5.6
I would suggest updating your .travis.yml to use the supported PHP versions in Moodle 3.5
You can find the dist file here: https://github.com/blackboard-open-source/moodle-plugin-ci/blob/master/.travis.dist.yml
Kind regards,
Matt
Error when using mssql and adding a new page
Form pages don't render for Moodle 3.9
In moodle 3.9 you still can create bunch of fields for your form page, but they don't get rendered on the page.
PHP Notice when saving the form page
Attempting to save the form page, I got:
Notice: Undefined offset: 1 in /local/pages/renderer.php on line 442
Missing hideIf in construct
Stack trace:
line 165 of /local/pages/forms/edit.php: Error thrown
line 194 of /lib/formslib.php: call to pages_edit_product_form->definition()
line 57 of /local/pages/forms/edit.php: call to moodleform->__construct()
line 410 of /local/pages/renderer.php: call to pages_edit_product_form->__construct()
line 56 of /local/pages/edit.php: call to local_pages_renderer->save_page()
Crumble path
L.s.
Marvellous plugin!
One issue: on a standard page, the crumble path is wrong.
Using Moodle 3,6,3,7 and 3.8
Best regards,
Bert
Error on moodle 3.11 (php 8)
Translation
I'm PT-PT translator.
Some sentences are hardcoded and it is not possible to translate them:
Examples:
In page "Manage Pages"
Add Page
PDF Manual
The button "Submit"
When adding/editing a page:
In Page Parent None is hardcoded.
In Display on menu Yes/No are hardcoded
Is it possible to tanslate 'page' and 'form' in the Type of page?
"Back to Page List" is hardcoded.
In Form Builder "Type" is hardcoded
It will be compatible to 3.6?
Thanks for the plugin
Typos in the plugin description
The plugin description at moodle.org/plugins seems to have two typos: "avaialbe" and "publicy"
Description could help more with the first steps
It might help for a new user if the plugin description had clear instructions for the first steps with the plugin - e.g. something like "go to Site administration > Plugins > Local plugins > Pages > Manage pages" and click "Add page" there.
These guidelines are important for all "local" plugins that have no unified place of appearance (such as activity modules or enrolments plugins).
PHP nortice Undefined offset when saving the form
Notice: Undefined offset: 1 in /local/pages/renderer.php on line 447
Capability local/pages:addpages without RISK_XSS
The page content is not cleaned before outputting, allowing to inject any kind of embedded JS scripts etc. If that is intentional, the capability allowing to create such a content, must be labelled with the RISK_XSS flag as it represents a risk of cross-site scripting attack.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.