Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with the button position #139

Open
ralf-krause opened this issue Aug 9, 2024 · 8 comments
Open

Problem with the button position #139

ralf-krause opened this issue Aug 9, 2024 · 8 comments
Assignees
Labels
Type: bug Something isn't working
Milestone

Comments

@ralf-krause
Copy link

ralf-krause commented Aug 9, 2024

Testing the new version of tool_moodlebox I found that on some pages the additional MoodleBox support buttons are switching into the top line. You can see this on the following pages.
http://moodlebox.home/admin/index.php?cache=1
http://moodlebox.home/admin/plugins.php
http://moodlebox.home/admin/environment.php

I can‘t say If we can see the problem only on admin pages.

I 'm using a Raspberry Pi 4B (4GB RAM), Moodle 4.4.1 (20240809), and the MoodleBox tool 2.18.0 (2024080700).

smartphone
@ralf-krause ralf-krause changed the title Problem with the button osition Problem with the button position Aug 9, 2024
@PatLemaire
Copy link
Collaborator

Which browser do you use? According to the screenshot, the problem is found on a mobile application?

@ralf-krause
Copy link
Author

I get this problem with all devices. I tested:

  • an iPad with Safari, Chrome and Firefox
  • my iPhone with Safari, Chrome and Firefox
  • an tablet with Android 14, Chrome and Firefox
  • my iMac 27" with macOS 13.6.9, Safari, Firefox, Chrome, Brave
  • Linux PC mit Chrome and Firefox

@ralf-krause
Copy link
Author

ralf-krause commented Aug 11, 2024

I tested some other things. I set the debugging message to DEVELOPER and I got no warnings from the MoodleBox tool and no warnings from other plugins.

In the MoodleBox settings I activated also the option "Show date and time setting in footer" and both button options were placed on the top of some admin pages. I tested if the option "Restart MoodleBox" really restarts it ... yes, it does. And after the MoodleBox is restarted the buttons are still on the top of these some admin pages.

@ralf-krause
Copy link
Author

How does the plugin put in the buttons to the page footer?
Is there a process which is waiting for the end of every page?
Is there a timeout which shows the buttons while some admin pages running to long?

@martignoni
Copy link
Member

martignoni commented Nov 3, 2024

How does the plugin put in the buttons to the page footer?

See function before_footer_html_generation.

Is there a process which is waiting for the end of every page?
Is there a timeout which shows the buttons while some admin pages running to long?

No and no.

@ralf-krause
Copy link
Author

The footer buttons are placed at the top of some admin pages also in the new MoodleBox 4.8.0. I tested this with a fresh installed MoodleBox so no one of my normally installed plugin can be the problem.

moodlebox-480-footer-buttons

@PatLemaire
Copy link
Collaborator

With the release of Moodle 4.4, some functions have been deprecated. We've had to rewrite some of the code to ensure compatibility, but placement is a problem. I'm going to see if manipulating the DOM in javascript might allow more efficient (stable) placement.

@PatLemaire PatLemaire self-assigned this Nov 6, 2024
@martignoni martignoni added the Type: bug Something isn't working label Nov 6, 2024
@martignoni martignoni added this to the 2.18.x milestone Nov 6, 2024
@PatLemaire
Copy link
Collaborator

For the moment, investigations show that the buttons are not positioned correctly on all pages where the $output->footer() function is not used as usual.
Let's quote https://moodledev.io/docs/4.4/apis/subsystems/output:

$PAGE->set_url($url);
$PAGE->set_title($title);
$PAGE->set_heading($title);

$output = $PAGE->get_renderer('tool_demo');

echo $output->header();
echo $output->heading($pagetitle);

$renderable = new \tool_demo\output\index_page('Some text');
echo $output->render($renderable);

echo $output->footer();

You seem to have listed the 3 pages concerned (others are intended to be called up indirectly).
A closer look at the code in admin/index.php, lines 823-824:

echo $OUTPUT->header();
echo $OUTPUT->footer();

Content of the page is build after footer call!

@martignoni martignoni modified the milestones: 2.18.x, 2.19.x Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: bug Something isn't working
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

3 participants