Code Monkey home page Code Monkey logo

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()

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()

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 :

withpages

without plugin PAGES :
without_ plugin_PAGES

would there be any additional css that I could put in the field?
Thank you

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

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()

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?

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.

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:

public function createform($data) {

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.

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)

We have trouble with the plugin on moodle 3.11.9 (2021051709) with the version of local_pages being 2021110400

We got the problem when we upgraded the php version to php 8.0. Now were not able to edit or add a page (see the image below for debug info)

debug

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

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).

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.