×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Some bugs and (my own amateur) solutions

Some bugs and (my own amateur) solutions 10 years 5 months ago #26335

  • Rob Swart
  • Rob Swart's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 57
  • Thank you received: 5
Hi Yves,

I've found some bugs and solutions to them.
I'm not really a php programmer, so I don't know if my solutions are truly ok, but they work for me.

1. SQL error when publishing or unpublishing an event in the administrator eventlist.
When clicking on the publish icon or when selecting an event and clicking the publish of unpublish button this error appears:
"1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 SQL=UPDATE vpcb_matukio_recurring SET published = '0' WHERE event_id IN ()"
As you can see the eventId is not filled.

My solution:
File: /administrator/components/com_matukio/controllers/eventlist.php
Find: public function publish() and after that // Update recurring events (line 106)
Add after this line the following code:
$db = JFactory::getDbo();
$cids = implode(',', $ids);

2. When editing a booking, my participants keep getting an error saying they did not accept the terms and conditions.
This is while the box for accepting is filled. I think it's because this box is disabled in some cases.

My solution:
File: /components/com_matukio/views/event/tmpl/default.php
Find: “// AGB-Bestaetigung anzeigen”
Disable the four lines of code on and after line 874:
// if ($this->art == 0 OR $this->art == 2 OR $this->art == 1 OR $this->art == 4 OR $tempdis != "")
// {
// $htx1 .= " disabled";
// }

I have no idea if I've killed some other function by doing this, but after extensive testing everything seems fine.

Maybe you can use this. Maybe not. Do with it whatever you like B)
It's also possible that I have overlooked the obvious and that there are other solutions to these bugs. Please tell me if so.

Some bugs and (my own amateur) solutions 10 years 5 months ago #26339

  • Yves Hoppe
  • Yves Hoppe's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 3519
  • Karma: 71
  • Thank you received: 556
Hi Rob,

1.) Hmm are we talking about the current version? If i recall correctly i fixed that in 4.0.3 or 4.0.4?

2.)

2. When editing a booking, my participants keep getting an error saying they did not accept the terms and conditions.


Your participants? Where? Normally every validation check is disabled when you edit a booking. Or do you mean in the old booking form?

Thanks for your help and feedback :)

Yves

Some bugs and (my own amateur) solutions 10 years 5 months ago #26349

  • Rob Swart
  • Rob Swart's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 57
  • Thank you received: 5
Hi Yves,

I've just installed version 4.0.6 and I'm sorry to report that the publish/unpublish sql error still exists.

About the second thing, i am still using the old booking form
I've tried the modern one, but I cannot seem to find a "Edit booking" button on this form, just a cancellation button. Therefore it's not usable for me.

Greets,
Rob

Some bugs and (my own amateur) solutions 10 years 5 months ago #26350

  • Yves Hoppe
  • Yves Hoppe's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 3519
  • Karma: 71
  • Thank you received: 556
Hmm okay i see the problem, the $cids are only there if participants are notified of the publishing / unpublishing of events (defaults to yes, that's the reason i couldn't replicate it), better solutions is moving

$cids = implode(',', $ids);

to the line before the if clause, so that they are always there. Will be fixed with 4.0.7.

Yves

Some bugs and (my own amateur) solutions 10 years 5 months ago #26351

  • Rob Swart
  • Rob Swart's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 57
  • Thank you received: 5
You're right. that works and is better code. But that's why you're the pro and I the amateur :)

Since I'm bughunting I've found another one that manifests since the latest version (or maybe 4.0.5, but I've skipped that one).
In the Upcoming events module I get a warning:
Warning: explode() expects parameter 2 to be string, array given in /modules/mod_matukio_upcoming/tmpl/default.php on line 19
It seems that you've added a line of code there lateley, this line is not present in version 4.0.4.:
$catids = explode(' ', $catids);

When deleting this line, the warning is gone.

And the last bug I've found:
When a event is not open for online booking and there are no bookings, the detailview of an event (default template) gives a warning:
Notice: Undefined variable: hidden in /components/com_matukio/views/event/tmpl/default.php on line 914
This is easily fixed by declaring the variable $hidden at line 24 ($hidden = "";) so it's always there.

Some bugs and (my own amateur) solutions 10 years 5 months ago #26352

  • Yves Hoppe
  • Yves Hoppe's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 3519
  • Karma: 71
  • Thank you received: 556

$catids = explode(' ', $catids);


Hmm added an if clause checking if the value is empty to that, so that the warning no longer shows up if you use all categories. This explode is required if you want to show multiple categories (not all!) in the upcoming module.

When a event is not open for online booking and there are no bookings, the detailview of an event (default template) gives a warning:


It's a notice and not a warning (not even near that) ;) But you are right should not happen, fixed. Interesting thing is that you have another line number then i had.

Yves
The following user(s) said Thank You: Rob Swart

Some bugs and (my own amateur) solutions 10 years 5 months ago #26354

  • Rob Swart
  • Rob Swart's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 57
  • Thank you received: 5
Thanks for those quick fixes!

I'm using all categories for the upcoming events, so I didn't see that the explode was used somewhere else.

And you're right it was a Notice. But anyway thanks for the fix, it's annoying when those appear on your site :)
The line number is different because I've added some custom code above this line to extract some data from my community builder database to fill some booking form zusatz fields. Don't worry about it ;)

Some bugs and (my own amateur) solutions 10 years 5 months ago #26358

  • Rob Swart
  • Rob Swart's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 57
  • Thank you received: 5
Hi Yves,

The last one for today. Filtering on old events in the modern event list does't work. It keeps giving me no results.
Strange thing is that I've seen it work on a older version of Matukio.

I've been bughunting again and found out that the sql query to filter events was this:
SELECT a.*, r.*, a.id as eventid FROM vpcb_matukio_recurring AS r LEFT JOIN vpcb_matukio AS a ON r.event_id = a.id WHERE r.published = '1' AND a.pattern = '' AND a.catid IN (74,75,76,77,78,79,80,81) AND r.end <= '2014-05-29 16:28:34' AND r.end > '2014-05-29 16:28:34'

As you can see there are two where clauses on the r.end column. Resulting in no results.
I found out that the first part of the query (all events) is made in util_events.php in the getEventList function.
This results is transported to the functions getAllEventsNormal , getAllEventsBooked and getAllEventsOffered.
In all three functions there then is another if clause that says:
if (!in_array('SEM_TYPES', $navioben) && MatukioHelperSettings::getSettings('event_stopshowing', 2) != 3)
		{
			$where[] = "$showend > '$cd'";
		}

This adds the other where clause.
My very crude solution was to comment out those three if statements, because I couldn't figure out why this statement was wrong.
This did the trick and old events are showing now.
I'm pretty sure you might find a more elegant solution to this problem, but hopefully you now know where to look.

Some bugs and (my own amateur) solutions 10 years 5 months ago #26361

  • Yves Hoppe
  • Yves Hoppe's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 3519
  • Karma: 71
  • Thank you received: 556
Hmm you are right, fixed.

Thanks again for your feedback and help!!

Yves

Some bugs and (my own amateur) solutions 10 years 5 months ago #26363

  • Rob Swart
  • Rob Swart's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 57
  • Thank you received: 5
You are very welcome.

Thanks for mentioning me in the release notes B)

Some bugs and (my own amateur) solutions 10 years 5 months ago #26389

  • Rob Swart
  • Rob Swart's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 57
  • Thank you received: 5
Hi Yves,

The correction you made on the "Show old events" function resulted in another small bug.
When logged in it works like a charm.
But when not logged in the "all events" view (including old events) is presented by default. I think it's better to show only the current events.

To do this I added an ELSE to the statement that constructs the query in util_events:
if ((in_array('SEM_TYPES', $navioben) && MatukioHelperSettings::getSettings('event_stopshowing', 2) != 3)
			|| ($layout == "modern" && MatukioHelperSettings::getSettings('event_stopshowing', 2) != 3
			&& MatukioHelperSettings::getSettings('navi_eventlist_types', 1) == 1 && $user->id > 0))
		{
			switch ($dateid)
			{
				case "1":
					if (empty($showend))
					{
						// In this case we have to set a begin
						$showend = "r.begin";
					}
 
					$where[] = "$showend > '$cd'";
					break;
 
				case "2":
					if (empty($showend))
					{
						// In this case we have to set a begin
						$showend = "r.begin";
					}
 
					$where[] = "$showend <= '$cd'";
					break;
			}
		}
		else
		{
				if (empty($showend))
				{
					// In this case we have to set a begin
					$showend = "r.begin";
				}
				$where[] = "$showend > '$cd'";
		}
The final ELSE statement is added.
Now when someone is not logged in he is presented with the list of future events.

Some bugs and (my own amateur) solutions 10 years 5 months ago #26390

  • Rob Swart
  • Rob Swart's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 57
  • Thank you received: 5

Rob Swart wrote: In the Upcoming events module I get a warning:
Warning: explode() expects parameter 2 to be string, array given in /modules/mod_matukio_upcoming/tmpl/default.php on line 19
It seems that you've added a line of code there lateley, this line is not present in version 4.0.4.:
$catids = explode(' ', $catids);

When deleting this line, the warning is gone.

I'm sorry to report that this bug still exists in 4.0.8.

Some bugs and (my own amateur) solutions 10 years 5 months ago #26394

  • Yves Hoppe
  • Yves Hoppe's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 3519
  • Karma: 71
  • Thank you received: 556
Confirmed and fixed.

Yves

Some bugs and (my own amateur) solutions 10 years 5 months ago #26809

  • Rob Swart
  • Rob Swart's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 57
  • Thank you received: 5
Hi Yves,

Hereby a confirmation that all above mentioned bugs are fixed and everything works OK.
Thanks!!!

Greets,
Rob
  • Page:
  • 1
Time to create page: 0.135 seconds