Project

General

Profile

Bug #3675

missing function in display class.

Added by Ludwig Theunis about 8 years ago. Updated almost 8 years ago.

Status:
Rejected - Abandoned
Priority:
High
Assignee:
-
Category:
-
Target version:
Start date:
01/07/2011
Due date:
% Done:

0%

Estimated time:
Complexity:
Normal
SCRUM pts - complexity:
100

Description

In the display class there are some functions to build a table,

Display::display_complex_table_header (...

Display::display_table_row (...

and in the past (<1.8.8.2 then came

Display::display_table_footer ();

Since 1.8.8.2 this call gives an fatal error.

Removing this call will result in a broken layout.

A temporarily solution is to replace the Display: display_table_footer();
with:
echo '</tbody></table>';

Or you can add the function back in /main/inc/lib/display.lib.php

/**
     *    Displays html footer of table
*/
public static function display_table_footer() {
echo '&lt;/tbody&gt;&lt;/table&gt;';
}

Files

exampletables.php (4.42 KB) exampletables.php Ludwig Theunis, 04/08/2011 22:12

Associated revisions

Revision 57ea6f13 (diff)
Added by Julio Montoya almost 8 years ago

Removing old table code see #3675

History

#1

Updated by Yannick Warnier almost 8 years ago

  • Target version set to 1.8.8.4
#2

Updated by Julio Montoya almost 8 years ago

  • Status changed from New to Needs more info

Hello Ludwing,

thanks for reporting, as far as I know in 1.8.8.4 that function is never used

#3

Updated by Ludwig Theunis almost 8 years ago

This method was demonstrated in the /main/template/exampletables.php. This still exists in 1.8.7.1
In 1.8.7.1 the method is also used in the main/user.php.

I see in 1.8.8.2 in 'main/user.php' the Display::display_table_footer();
is replaced by echo '</tbody></table>';
I've written a rather big plugin were it is used more then once. So for downward compatibility it should be back there, otherwise users using my plugin get in trouble when they don't know PHP.

Also the related methods like:
Display::display_complex_table_header(...
and
Display::display_table_row(...

are still used in 1.8.8.2

So I'm pretty sure that the function is deleted by accident, and is afterwards fixed by the line..
echo '</tbody></table>'; in main/user.php

So I would appreciate the method "Display::display_table_footer();" to be back in class. I can't be a big problem I think.

Perhaps more people use this function in their plugins or modification.
For me it is not a problem because I'm still using 1.8.5 and going to switch to 2.0 as soon as the plugin is rewritten.
But I think it is not logical I have to fix my plugin when there is bug introduced by a newer chamilo bugfix release.

#4

Updated by Yannick Warnier almost 8 years ago

  • Status changed from Needs more info to Assigned
  • Assignee set to Julio Montoya

OK, let's re-add the function then.
Ludwig, don't hesitate to share your plugins with us if you may.

#5

Updated by Julio Montoya almost 8 years ago

  • Status changed from Assigned to Needs more info
  • Assignee deleted (Julio Montoya)

Yannick Warnier wrote:

OK, let's re-add the function then.
Ludwig, don't hesitate to share your plugins with us if you may.

He can edit his plugin and create a function or simply add that

echo '</tbody></table>'

he can also use the Sortableclass or even use the HTMLTable (see an example in main/gradebook/user_stats.php)

That function is useless in Chamilo.

#6

Updated by Yannick Warnier almost 8 years ago

  • Assignee set to Julio Montoya

Julio Montoya wrote:

That function is useless in Chamilo.

Isn't that true for the display_table_header too then? I'll be having a look at Ludwig's extension (which he is already sharing publicly) after 1.8.8.4, but it makes sense to me to avoid having to call a header function but not a footer function (how are people supposed to know what they should write if they create a plugin which uses them?), but I don't really care that much, as long as it's a justified decision.

Julio, you say the function is useless in Chamilo. However it "completes" other functions. If you think it really shouldn't go there, then (it would be logical to say that) the header functions shouldn't either. What do you think?

#7

Updated by Julio Montoya almost 8 years ago

  • Assignee deleted (Julio Montoya)
  • % Done changed from 0 to 30

yes of course the display_complex_table_header is never use in Chamilo (well in fact is use in user.php to show virtual courses that returns empty right now I'm removed the code with http://code.google.com/p/chamilo/source/detail?r=554f9074ff8a8573a6df7640ee45a25283090133&repo=classic)

In the display_complex_table_header are some constants like DOKEOSLIGHTGREY!!!

#8

Updated by Yannick Warnier almost 8 years ago

  • Status changed from Needs more info to Rejected - Abandoned

Julio Montoya wrote:

yes of course the display_complex_table_header is never use in Chamilo (well in fact is use in user.php to show virtual courses that returns empty right now I'm removed the code with http://code.google.com/p/chamilo/source/detail?r=554f9074ff8a8573a6df7640ee45a25283090133&repo=classic)

In the display_complex_table_header are some constants like DOKEOSLIGHTGREY!!!

Hahaha! OK, so never used. Well OK, I don't mind removing it too, then.

Ludwig, I'm sorry but considering these functions are never used, I suggest you declare the functions in your plugin. You can easily make a conditional declaration:

<?php
if (function_exists('display_table_footer')) {
  exit;
}
function display_table_footer() {
  echo '</tbody></table>';
}

... or something like that

If you think this is really a problem, please discuss it here. We're open-minded but we also want to clean our code a little from time to time.

#9

Updated by Ludwig Theunis almost 8 years ago

I'm sorry to hear that.
Who ever is saying that it is never been used, lies, because it is used as I stated before in previous versions.

It is not as simple as you suggest because it is part of the Display class. I don't want to change anything in the original chamilo code because it is an PLUGIN.
And I also don't want to have to copy every class I use from the chamilo code in to my plugin to be sure it stays there. What's the point of that!

I don't like the way this is going, I once developed a plugin, following the manuals and the examples in the source at that time 1.8.x. I used a function, now someone decides 4 lines of code are to much to keep chamilo 1.8.8.x downwards compatible whit in its own branch!!

I know you can't keep every thing in the code for downwards compatibility, so in a new version lets say 1.9 or higher, I can understand that it disappears. But in an update from 1.8.7.2 to 1.8.8.4 this is nonsense.

But if you don't put it back in like it should. So be it. I will not fix it in my plugin.

To bad for the users who follow chamilo 1.8.8.X and want to use the plugin.
I only wanted to share a really useful plugin. so it stops at 1.8.7.2.

I'm only worried that apparantly there is more time to discuss something which shouldn't be discussed at all, rather than simple put 4 lines of code back in.

From this moment on I only will work on 2.0 regarding the plugin. Because this already took to much of my time.

Regards,

Ludwig

#10

Updated by Julio Montoya almost 8 years ago

Ludwig Theunis wrote:

I'm sorry to hear that.
Who ever is saying that it is never been used, lies, because it is used as I stated before in previous versions.

"Whoever". It's me Julio and I'm not a liar. You don't know me and you don't know the Chamilo code enough, so that's why you are maybe confused.

As I said in my first comment:

thanks for reporting, as far as I know in 1.8.8.4 that function is never used

2 things: As far as I KNOW and in 1.8.8.4

"As far as I know" because I don't have in memory all the chamilo functions and calls and "in 1.8.8.4" because we're discussing about a Chamili version that is NOT finished yet!!! And yes that function used to exist in user.php (I already removed it in 1.8.8.4 ) but it does nothing because it's an old code to get "virtual courses". There is also task (#3144) to REMOVE that old functionality. That's why I said is USELESS, because the virtual courses are also useless!!

And I'm not a liar because that function could work in Dokeos 1.8.4 or Dokeos 1.8.5 but not any more in Chamilo 1.8.8.4

It is not as simple as you suggest because it is part of the Display class. I don't want to change anything in the original chamilo code because it is an PLUGIN.
And I also don't want to have to copy every class I use from the chamilo code in to my plugin to be sure it stays there. What's the point of that!

Yes, it's simple just update your plugin and print your table or do what Yannick suggested. If you don't want to change it, that's not my problem.

I don't like the way this is going, I once developed a plugin, following the manuals and the examples in the source at that time 1.8.x. I used a function, now someone decides 4 lines of code are to much to keep chamilo 1.8.8.x downwards compatible whit in its own branch!!

"Someone" is me. And I removed those functions because they are stupid, c'mon those functions are not a VITAL for the "Chamilo kernel". I decided to removed it because it makes me sad and angry to maintain some code to print a table, when you have a LOT of better alternatives as I said before: Display::tag, Display::SortableTable or just echo a tag. You just don't listen our professional advices. You just want your old code there.

I know you can't keep every thing in the code for downwards compatibility, so in a new version lets say 1.9 or higher, I can understand that it disappears. But in an update from 1.8.7.2 to 1.8.8.4 this is nonsense.

The sooner the better, I'm surprised that I didn't find that function before to remove it in Chamilo 1.8.7 or sooner. Nobody deserves to call those functions and if you really need it, that reflects a lot about your developer skills. I'm not changing the KERNEL of the code is just some functions that echos some HTML tags for god's sake!

But if you don't put it back in like it should. So be it. I will not fix it in my plugin.

To bad for the users who follow chamilo 1.8.8.X and want to use the plugin.
I only wanted to share a really useful plugin. so it stops at 1.8.7.2.

Where can I find your plugin? What does your plugin do? It's GPL? You have the code hosted in google code, github? I don't even know your plugin's name.
Is not bad for users who follow Chamilo 1.8.8.X because the world will not end because your plugin doesn't work in Chamilo 1.8.8.4. If the community really needs it they're going to ask to add it to chamilo 1.9 or just to make it work in Chamilo 1.8.8.4.

Anybody can fix it or fork it or I could even added to Chamilo if the code is clean and adds value to the community, you are not the only one who can create or edit a plugin.

I'm only worried that apparantly there is more time to discuss something which shouldn't be discussed at all, rather than simple put 4 lines of code back in.

You should put your 4 lines in your code and then close this task. I never seen before someone who wants a function that echos some tags. We have tons of old code that we're trying to clean and maintain, thanks to that, the current code is cleaner than Dokeos 1.8.6 or even Chamilo 1.8.7 prove of that are all the commits I sent daily http://www.ohloh.net/p/chamilo/contributors/2062619389214381 and the Yannick's work adding php doc compatibility.

From this moment on I only will work on 2.0 regarding the plugin. Because this already took to much of my time.

Fine. This task is also a waste of time for me.

Regards,

Ludwig

Julio

#11

Updated by Ludwig Theunis almost 8 years ago

'Never used' is always referring to the past and not to the future, in that case it's a lie. 1.8.8.4 is the future (you think), but 1.8.8.2 is the presence and there it is already removed, braking some chamilo installations who worked perfectly in 1.8.7.2, ... probably not hosted by your company...

You don't have to shoot at me, I've got a question from some one using chamilo 1.8.x together with my plugin, after updating to 1.8.8.2 he got a problem. He asked me. (Apparently not everybody using chamilo are programmers and are asking for help.) I looked into it, analyzed the code an saw what is different. I quickly gave him the two alternative solutions, hoping that he can fix this himself. By the way I'm not getting paid to do this and I don't need to get paid to do this. To help (for free) other people with, perhaps, similar problems I only wanted to share this to the chamilo 1.8.X community. In the D-times I contributed my share of fixes.....
I was convinced this function was deleted by mistake, because I could not believe that one would delete something which was in a template or code guideline ... braking every code written following the example of the template. Luckily apparent only I follow some guidelines from 'programmers' ('But you probably call those people something else, because you're the best...') and only my plugin is affected and 1 file in the kernel which you already fixed.

I also believed this wouldn't be much of a discussion. Again my mistake!

Maybe I don't know the chamilo code enough, maybe I'm not much of a programmer, I certainly don't call myself a programmer, I also do not get paid for it, you do. But is that a necessity to contribute to the opensource Chamilo project. Since when? I'm using Chamilo since the D time D1.5.5 and the plugin exists from the D1.8.0 version. Because I'm not a 'professional programmer' I'me stupid and don't have any saying in this.

Back then I asked for a place to publish the plugin, I asked for a space when Chamilo is founded. It did never happen. I'm not selling it, just sharing my effort, I'm not advertising because I don't need money for it. so don't blame me if you don't know. If you are interested, from what I hear you're not, you check it out at: http://www.openelo.be.

But don't bother to change this for me, by all means do not!!! I quit the 1.8.X branch long time ago. I was only helping some users for free!!!

I'm only curious what's the next thing you decide is stupid...

Like you say it just is a functions that echos some HTML tags. But my point is this is taken from a code template one should use to generate new features and commit them to the community.
Who am I to say this code is rubbish. Apparently you can, not taking into account of anyone else.
And you are right the 1.8.x needs a clean up, thats why I'me focusing to the 2.0 branche.

In the attachment you can find the template I'm talking about it's there from the beginning and it still was in Chamilo 1.8.7.2, and was deleted in Chamilo 1.8.8.2, so if I only made a plugin using this template a few months ago, I all ready would have to change it..... good thinking....

Sincerely

Ludwig Theunis
Founding member Chamilo

#12

Updated by Julio Montoya almost 8 years ago

Ludwig Theunis wrote:

'Never used' is always referring to the past and not to the future, in that case it's a lie. 1.8.8.4 is the future (you think), but 1.8.8.2 is the presence and there it is already removed, braking some chamilo installations who worked perfectly in 1.8.7.2, ... probably not hosted by your company...

Again, I'm talking about Chamilo 1.8.8.4 a version that isn't release yet. I'm not talking about older versions. That's why I precise the version. So again that's not a lie.

You don't have to shoot at me, I've got a question from some one using chamilo 1.8.x together with my plugin, after updating to 1.8.8.2 he got a problem. He asked me. (Apparently not everybody using chamilo are programmers and are asking for help.) I looked into it, analyzed the code an saw what is different. I quickly gave him the two alternative solutions, hoping that he can fix this himself. By the way I'm not getting paid to do this and I don't need to get paid to do this. To help (for free) other people with, perhaps, similar problems I only wanted to share this to the chamilo 1.8.X community. In the D-times I contributed my share of fixes.....

I'm not shooting you. You are shooting yourself telling other people's liar. You can't go out happily in life telling those attributions to somebody. You could tell me that I'm wrong or that I miss something I could accepted that or maybe it was a misunderstood but you decided to not be diplomatic.

Those problems happens when you created a plugin and you don't care about it. You just released it and you want to work for ALL future versions of Chamilo.
Just look Firefox's extensions. All extensions have a Firefox version where the plugin will work perfectly but there are other FF version like Firefox 5. where the plugin will not be complaint. You want that your plugin lives forever and ever just because you release it and make it available in an island where nobody at least I didn't know it even exists!! Well, to be honest that's our fault too, we don't have the right place for Chamilo extensions/plugins I guess that's a lack of organization.

I was convinced this function was deleted by mistake, because I could not believe that one would delete something which was in a template or code guideline ... braking every code written following the example of the template. Luckily apparent only I follow some guidelines from 'programmers' ('But you probably call those people something else, because you're the best...') and only my plugin is affected and 1 file in the kernel which you already fixed.

That file exampletables.php doesn't exists in Chamilo since version 1.8.8 I didn't deleted that file you can see that change here:

http://support.chamilo.org/projects/chamilo-18/repository/revisions/12452

I also believed this wouldn't be much of a discussion. Again my mistake!

Maybe I don't know the chamilo code enough, maybe I'm not much of a programmer, I certainly don't call myself a programmer, I also do not get paid for it, you do. But is that a necessity to contribute to the opensource Chamilo project. Since when? I'm using Chamilo since the D time D1.5.5 and the plugin exists from the D1.8.0 version. Because I'm not a 'professional programmer' I'me stupid and don't have any saying in this.

So, if you don't know the Chamilo code enough and you are not much of a programmer (as you said) and you don't get paid and you left the Chamilo 1.8 branch, why don't you believe our professional advice that removing those functions are the best for the community and the code's health? You just want that your plugin works forever!! (ah yes you also you don't want to change your code).

Back then I asked for a place to publish the plugin, I asked for a space when Chamilo is founded. It did never happen. I'm not selling it, just sharing my effort, I'm not advertising because I don't need money for it. so don't blame me if you don't know. If you are interested, from what I hear you're not, you check it out at: http://www.openelo.be.

You're totally right, I'm sorry that you had a bad experience dealing with the commercial/publicity part of Chamilo. If I was in charge of that area I will do a lot of improvements to create a special place for plugins or other stuff, sadly I don't have that power and those responsibilities , I'm just a developer.

But don't bother to change this for me, by all means do not!!! I quit the 1.8.X branch long time ago. I was only helping some users for free!!!

I'm only curious what's the next thing you decide is stupid...

I'm not going to change anything don't worry.

Like you say it just is a functions that echos some HTML tags. But my point is this is taken from a code template one should use to generate new features and commit them to the community.

That code template you said doesn't exist since Chamilo 1.8.8 I don't even deleted.

Who am I to say this code is rubbish. Apparently you can, not taking into account of anyone else.
And you are right the 1.8.x needs a clean up, thats why I'me focusing to the 2.0 branche.

Good luck with 2.0

In the attachment you can find the template I'm talking about it's there from the beginning and it still was in Chamilo 1.8.7.2, and was deleted in Chamilo 1.8.8.2, so if I only made a plugin using this template a few months ago, I all ready would have to change it..... good thinking....

You are wrong that file was deleted in Chamilo 1.8.8. The prove is in the commit (above) and in the official zip package in google code. Again, I didn't deleted.
Good thinking :)

Sincerely

Ludwig Theunis
Founding member Chamilo

Julio

Also available in: Atom PDF