Non-core contributed modules

MRBS Entry can not be deleted

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.9, 1.9.1, 1.9.2, 1.9.3, 1.9.4
  • Fix Version/s: None
  • Component/s: Block: Mrbs
  • Labels:
    None
  • Environment:
    Moodle 1.9.5+
    MRBS (Latest) 2009061900
  • Database:
    MySQL
  • Difficulty:
    Difficult
  • Affected Branches:
    MOODLE_19_STABLE

Description

Hallo,
we have a big problem with this block.
If anyone (admin account too) make a booking, no one can delete this entry.
Can anyone help me, or give me a idea whats going wrong?

Jens (Germany)

  1. edit_entry.php
    22/Sep/09 11:59 PM
    20 kB
    Jens-Peter misch
  1. mrbs bug.png
    148 kB
    18/Sep/09 10:37 PM
  2. screenshot-1.jpg
    142 kB
    18/Sep/09 12:04 PM

Activity

Hide
Anthony Borrow added a comment -

Jens - I have not seen this behavior before. Do you have the admin user setup as being mrbs_admins? I'd be willing to try and figure out what is happening with you but will need more information. As you probably know, I like screen shots. Let me know how I can help. Peace - Anthony

Show
Anthony Borrow added a comment - Jens - I have not seen this behavior before. Do you have the admin user setup as being mrbs_admins? I'd be willing to try and figure out what is happening with you but will need more information. As you probably know, I like screen shots. Let me know how I can help. Peace - Anthony
Hide
Jens-Peter misch added a comment -

Hallo Anony,
I´m logged in as Admin, with all rights for the mrbs block. I make a booking of an resource. When I then go again to the booking, you see the following screen. Ther is no way to delete the booking - for anyone....

Jens

Show
Jens-Peter misch added a comment - Hallo Anony, I´m logged in as Admin, with all rights for the mrbs block. I make a booking of an resource. When I then go again to the booking, you see the following screen. Ther is no way to delete the booking - for anyone.... Jens
Hide
Jens-Peter misch added a comment -

Here the screenshot....

Show
Jens-Peter misch added a comment - Here the screenshot....
Hide
Anthony Borrow added a comment -

Jens - I noticed that this was the latest version with some changes that Mike Worth made. I have added Mike as a watcher but am hoping he might come and steal this issue away from me I am not sure if it may be related to some of the changes he made or not. I'll have to install the latest version on my test server and see if I can reproduce. Peace - Anthony

Show
Anthony Borrow added a comment - Jens - I noticed that this was the latest version with some changes that Mike Worth made. I have added Mike as a watcher but am hoping he might come and steal this issue away from me I am not sure if it may be related to some of the changes he made or not. I'll have to install the latest version on my test server and see if I can reproduce. Peace - Anthony
Hide
Mike Worth added a comment -

You should be seeing a 'Delete Entry' link next to the save button (see screenshot)

I have a feeling there was a version at one time or another that was missing this link- try upgrading to the latest version and see it that fixes the issue

Thanks,
Mike

Show
Mike Worth added a comment - You should be seeing a 'Delete Entry' link next to the save button (see screenshot) I have a feeling there was a version at one time or another that was missing this link- try upgrading to the latest version and see it that fixes the issue Thanks, Mike
Hide
Jens-Peter misch added a comment -

OK
can you give me a link where I can find this version from your picture. I look totally different to what i get when I use the latest version from moodle.org modules....

Jens

Show
Jens-Peter misch added a comment - OK can you give me a link where I can find this version from your picture. I look totally different to what i get when I use the latest version from moodle.org modules.... Jens
Hide
Anthony Borrow added a comment -

Mike - Thanks for taking this on. Peace - Anthony

Show
Anthony Borrow added a comment - Mike - Thanks for taking this on. Peace - Anthony
Hide
Mike Worth added a comment -

That is the address of the latest version; the reason mine looks different will be a combination of my different operating system, my local theme and the big list of bullet points is a local customisation.

Could you please post me a copy of mrbs/web/edit_entry.php from your server and a copy of the html file of that page that is output as well please

Thanks,
Mike

Show
Mike Worth added a comment - That is the address of the latest version; the reason mine looks different will be a combination of my different operating system, my local theme and the big list of bullet points is a local customisation. Could you please post me a copy of mrbs/web/edit_entry.php from your server and a copy of the html file of that page that is output as well please Thanks, Mike
Hide
Jens-Peter misch added a comment -

here is the file you want....we have this problem with nearly 1000 moodle systems here in germany. we are hosting them for many schools in germany baden württemberg (Belwue)....
So you see it is very urgent

Jens-Peter Misch

Show
Jens-Peter misch added a comment - here is the file you want....we have this problem with nearly 1000 moodle systems here in germany. we are hosting them for many schools in germany baden württemberg (Belwue).... So you see it is very urgent Jens-Peter Misch
Hide
Anthony Borrow added a comment -

Jens-Peter - Thanks for letting me know the urgency of this. I have 6 hours in the classroom today but will try to give this a look and see what is happening this evening. Just to make sure you are using 1.9.5+ and the HEAD branch of the mrbs block - is that correct? Peace - Anthony

Show
Anthony Borrow added a comment - Jens-Peter - Thanks for letting me know the urgency of this. I have 6 hours in the classroom today but will try to give this a look and see what is happening this evening. Just to make sure you are using 1.9.5+ and the HEAD branch of the mrbs block - is that correct? Peace - Anthony
Hide
Anthony Borrow added a comment -

Jens-Peter - No need to respond to my last question, I just looked at the environment information provided with the issue. Peace - Anthony

Show
Anthony Borrow added a comment - Jens-Peter - No need to respond to my last question, I just looked at the environment information provided with the issue. Peace - Anthony
Hide
Jens-Peter misch added a comment -

hi,
did anyone have the time to test it, i got more and more questions about this bug...

jens

Show
Jens-Peter misch added a comment - hi, did anyone have the time to test it, i got more and more questions about this bug... jens
Hide
Anthony Borrow added a comment -

Jens - Bring on the questions. Unfortunately I have not had a chance to look into it yet but will try to make an effort this evening. Peace - Anthony

Show
Anthony Borrow added a comment - Jens - Bring on the questions. Unfortunately I have not had a chance to look into it yet but will try to make an effort this evening. Peace - Anthony
Hide
Anthony Borrow added a comment -

Jens - I am not able to reproduce the issue in English. Have you tried this on a fresh installation of the block with the latest code as Mike suggested? I am going to test with German to see if that makes a difference for some reason. Any clues you have that would help me to reproduce the issue would be appreciated. Peace - Anthony

Show
Anthony Borrow added a comment - Jens - I am not able to reproduce the issue in English. Have you tried this on a fresh installation of the block with the latest code as Mike suggested? I am going to test with German to see if that makes a difference for some reason. Any clues you have that would help me to reproduce the issue would be appreciated. Peace - Anthony
Hide
Anthony Borrow added a comment -

Jens - I did confirm the behavior with the German language file. I have no idea why it does not show up in English. What you may wish to do is remove the <NOSCRIPT> and corresponding </NOSCRIPT> tags. As I understand those tags they are to be used when the browser does not support javascript. As such when javascript is supported then the link is not there which seems to be your complaint. I think the link should always be there but I am not sure what Mike means by adding the delete links when redirected. The down side to removing the <NOSCRIPT> tags is that there is no delete confirmation but I suspect your users will be happy just to be able to delete. Keep in mind that the HEAD branch (latest) is the development branch and may not be as stable. I am not sure if there is some of the newer functionality that Mike has been working on that your users are using but you may want to consider using the 19STABLE version. I hope that Mike is also able to comment on this and give the newer code a closer look and some more testing. One little thing I noticed was that the closing <a> tag was </A> which while perhaps trivial I would like to see cleaned up. Peace - Anthony

Show
Anthony Borrow added a comment - Jens - I did confirm the behavior with the German language file. I have no idea why it does not show up in English. What you may wish to do is remove the <NOSCRIPT> and corresponding </NOSCRIPT> tags. As I understand those tags they are to be used when the browser does not support javascript. As such when javascript is supported then the link is not there which seems to be your complaint. I think the link should always be there but I am not sure what Mike means by adding the delete links when redirected. The down side to removing the <NOSCRIPT> tags is that there is no delete confirmation but I suspect your users will be happy just to be able to delete. Keep in mind that the HEAD branch (latest) is the development branch and may not be as stable. I am not sure if there is some of the newer functionality that Mike has been working on that your users are using but you may want to consider using the 19STABLE version. I hope that Mike is also able to comment on this and give the newer code a closer look and some more testing. One little thing I noticed was that the closing <a> tag was </A> which while perhaps trivial I would like to see cleaned up. Peace - Anthony
Hide
Anthony Borrow added a comment -

Jens - Actually a little closer look at the code reveals that some new lines in the German language string for 'confirmdel' may be causing the Javascript not to render properly. I removed the new lines (
n) from the language string and that resolved the issue. Peace - Anthony

Show
Anthony Borrow added a comment - Jens - Actually a little closer look at the code reveals that some new lines in the German language string for 'confirmdel' may be causing the Javascript not to render properly. I removed the new lines (
n) from the language string and that resolved the issue. Peace - Anthony
Hide
Anthony Borrow added a comment -

Mike - Of course this only shows how easily things can be broken with the use of the javascript writeln code so I would discourage using it. Typically in Moodle when we want to confirm we use an optional confirm variable and check for it. Let me know if you want me to find some examples but I think that would be better than using the javascript here. Of course feel free to consult on the General Developers forum to see what others think. I have committed the changes to the language file as I am not sure why the new lines were there in the first place. Technically that resolves the issue but you may want to give this some thought. Peace - Anthony

Show
Anthony Borrow added a comment - Mike - Of course this only shows how easily things can be broken with the use of the javascript writeln code so I would discourage using it. Typically in Moodle when we want to confirm we use an optional confirm variable and check for it. Let me know if you want me to find some examples but I think that would be better than using the javascript here. Of course feel free to consult on the General Developers forum to see what others think. I have committed the changes to the language file as I am not sure why the new lines were there in the first place. Technically that resolves the issue but you may want to give this some thought. Peace - Anthony
Hide
Anthony Borrow added a comment -

Mike - I am going to go ahead and mark this as resolved since the fix to the German language file should resolve the issue for Jens; however, feel free to re-open or close as you think best. Peace - Anthony

Show
Anthony Borrow added a comment - Mike - I am going to go ahead and mark this as resolved since the fix to the German language file should resolve the issue for Jens; however, feel free to re-open or close as you think best. Peace - Anthony
Hide
Anthony Borrow added a comment -

Mike - I am reopening this as there are many languages affected. I would suggest removing all of the /n from the language files. Otherwise, you will need to look at the code and figure out how to make it work with the line breaks. Peace - Anthony

Show
Anthony Borrow added a comment - Mike - I am reopening this as there are many languages affected. I would suggest removing all of the /n from the language files. Otherwise, you will need to look at the code and figure out how to make it work with the line breaks. Peace - Anthony
Hide
Jens-Peter misch added a comment -

Hi Anthony and Mike,
thank you, and I will make the german lang file. Please let me know if you make changes in the front end of moodle, so i have a chance to write the german lang file for you
Or send me direct the new english lang file and i will translate it for you....
what should i do next for you, should i wait with translating and you give me the information when i can make the work or should i go direct to translate it...

jens

Show
Jens-Peter misch added a comment - Hi Anthony and Mike, thank you, and I will make the german lang file. Please let me know if you make changes in the front end of moodle, so i have a chance to write the german lang file for you Or send me direct the new english lang file and i will translate it for you.... what should i do next for you, should i wait with translating and you give me the information when i can make the work or should i go direct to translate it... jens
Hide
Anthony Borrow added a comment -

Jens - If you want you should be able to just use the latest version as I removed the new lines so as far as I know the German language file should be fine. I re-opened the issue because other languages had the new lines in there so I wanted Mike to look at those when he gets the change. The latest download should allow things to work smoothly for you. If you have any questions just let me know. The priority was to get things working for you and your users. Peace - Anthony

Show
Anthony Borrow added a comment - Jens - If you want you should be able to just use the latest version as I removed the new lines so as far as I know the German language file should be fine. I re-opened the issue because other languages had the new lines in there so I wanted Mike to look at those when he gets the change. The latest download should allow things to work smoothly for you. If you have any questions just let me know. The priority was to get things working for you and your users. Peace - Anthony
Hide
Eric S. Wei added a comment - - edited

Hi All,

I'm not a native English speaker, but I'll try my best.

I installed the latest version of MRBS with zh_tw_utf8 language package for my school two days ago and I encountered the same problem that "Delete Entry" didn't show up at right side of SAVE button.

I started to check on view_entry.php I figured out something it might help debugging. if I replace .get_string('confirmdel', 'block_mrbs') by string "Do you want to delete?", The "Delete Entry" will show up in browser and the java alert message will pop out too. It worked just fine. I'm not sure if it is the javascript, get_string(), language package or something else causes the problem.

There is one more problem. The variables $series and $repeat_id seem don't get any value, therefore, it will not print out "Delete Series". Any ideas?

<?php
if($id){
if( ! $series )
/* echo "<NOSCRIPT><a id=\"dellink\" HREF=\"del_entry.php?id=$id&series=0\">".get_string('deleteentry','block_mrbs')."</A></NOSCRIPT>"
."<script type=\"text/javascript\">
document.writeln('<a href=\"#\" onClick=\"if(confirm(\'".get_string('confirmdel','block_mrbs')."\')){document.location=\'del_entry.php?id=$id&series=0\';}\">".get_string('deleteentry','block_mrbs')."</a>');
</script>";
*/
// make change on .get_string('confirmdel', 'block_mrbs')

echo "<NOSCRIPT><a id=\"dellink\" HREF=\"del_entry.php?id=$id&series=0\">".get_string('deleteentry','block_mrbs')."</A></NOSCRIPT>"
."<script type=\"text/javascript\">
document.writeln('<a href=\"#\" onClick=\"if(confirm(\'Do you want to delete?\')){document.location='del_entry.php?id=$id&series=0';};}\">".get_string('deleteentry','block_mrbs')."</a>');
</script>";

if($repeat_id)
echo " - ";

if($repeat_id || $series )
echo "<NOSCRIPT><a id=\"dellink\" HREF=\"del_entry.php?id=$id&series=1&day=$day&month=$month&year=$year\">".get_string('deleteentry','block_mrbs')."</A></NOSCRIPT>"
."<script type=\"text/javascript\">
document.writeln('<a href=\"#\" onClick=\"if(confirm(\'".get_string('confirmdel','block_mrbs')."\')){document.location=\'del_entry.php?id=$id&series=1&day=$day&month=$month&year=$year\';}\">".get_string('deleteseries','block_mrbs')."</a>');
</script>";
}
?>

Show
Eric S. Wei added a comment - - edited Hi All, I'm not a native English speaker, but I'll try my best. I installed the latest version of MRBS with zh_tw_utf8 language package for my school two days ago and I encountered the same problem that "Delete Entry" didn't show up at right side of SAVE button. I started to check on view_entry.php I figured out something it might help debugging. if I replace .get_string('confirmdel', 'block_mrbs') by string "Do you want to delete?", The "Delete Entry" will show up in browser and the java alert message will pop out too. It worked just fine. I'm not sure if it is the javascript, get_string(), language package or something else causes the problem. There is one more problem. The variables $series and $repeat_id seem don't get any value, therefore, it will not print out "Delete Series". Any ideas? <?php if($id){ if( ! $series ) /* echo "<NOSCRIPT><a id=\"dellink\" HREF=\"del_entry.php?id=$id&series=0\">".get_string('deleteentry','block_mrbs')."</A></NOSCRIPT>" ."<script type=\"text/javascript\"> document.writeln('<a href=\"#\" onClick=\"if(confirm(\'".get_string('confirmdel','block_mrbs')."\')){document.location=\'del_entry.php?id=$id&series=0\';}\">".get_string('deleteentry','block_mrbs')."</a>'); </script>"; */ // make change on .get_string('confirmdel', 'block_mrbs') echo "<NOSCRIPT><a id=\"dellink\" HREF=\"del_entry.php?id=$id&series=0\">".get_string('deleteentry','block_mrbs')."</A></NOSCRIPT>" ."<script type=\"text/javascript\"> document.writeln('<a href=\"#\" onClick=\"if(confirm(\'Do you want to delete?\')){document.location='del_entry.php?id=$id&series=0';};}\">".get_string('deleteentry','block_mrbs')."</a>'); </script>"; if($repeat_id) echo " - "; if($repeat_id || $series ) echo "<NOSCRIPT><a id=\"dellink\" HREF=\"del_entry.php?id=$id&series=1&day=$day&month=$month&year=$year\">".get_string('deleteentry','block_mrbs')."</A></NOSCRIPT>" ."<script type=\"text/javascript\"> document.writeln('<a href=\"#\" onClick=\"if(confirm(\'".get_string('confirmdel','block_mrbs')."\')){document.location=\'del_entry.php?id=$id&series=1&day=$day&month=$month&year=$year\';}\">".get_string('deleteseries','block_mrbs')."</a>'); </script>"; } ?>
Hide
Anthony Borrow added a comment -

Eric - Thanks for sharing your comments and experience. What you describes makes sense. I am recommending that folks go through and remove any of the new lines in their language packs. So you can still use the get_string('confirmdel','block_mrbs') but you need to make it so that it does not contain the new line. So if you change /blocks/mrbs/lang/zh_tw_utf8/block_mrbs.php around line 103 from:

$string["confirmdel"] = "???????????
n";

to

$string["confirmdel"] = "???????????";

It should resolve the issue. Let me know if you have any other questions or problems doing this. Peace - Anthony

Show
Anthony Borrow added a comment - Eric - Thanks for sharing your comments and experience. What you describes makes sense. I am recommending that folks go through and remove any of the new lines in their language packs. So you can still use the get_string('confirmdel','block_mrbs') but you need to make it so that it does not contain the new line. So if you change /blocks/mrbs/lang/zh_tw_utf8/block_mrbs.php around line 103 from: $string["confirmdel"] = "???????????
n"; to $string["confirmdel"] = "???????????"; It should resolve the issue. Let me know if you have any other questions or problems doing this. Peace - Anthony
Hide
Eric S. Wei added a comment -

Anthony, Thank you. It works.

I comment out

574 // if($repeat_id)

578 // if($repeat_id || $series )

in edit_entry.php

so the user scan do series deleting. Will that be a problem?

Thanks again

Show
Eric S. Wei added a comment - Anthony, Thank you. It works. I comment out 574 // if($repeat_id) 578 // if($repeat_id || $series ) in edit_entry.php so the user scan do series deleting. Will that be a problem? Thanks again
Hide
Anthony Borrow added a comment -

I am going to resolve this as fixed as I have removed all of the newline - /n - characters from all of the language files. Hopefully that will avoid the problem. If I am mistaken, please open a new issue. Peace - Anthony

Show
Anthony Borrow added a comment - I am going to resolve this as fixed as I have removed all of the newline - /n - characters from all of the language files. Hopefully that will avoid the problem. If I am mistaken, please open a new issue. Peace - Anthony

People

Vote (0)
Watch (4)

Dates

  • Created:
    Updated:
    Resolved: