Lessons doesn't show
I have two courses where the lessons doesn't show. The rest of the courses looks fine.
Why, oh why... :)
/Bosse
No show:
www.rolfmunke.se/index.php/2016-03-25-13...-4-kg-pa-fyra-veckor
www.rolfmunke.se/index.php/component/gur...ed-rolf-300-000-steg
The rest look like this (as they should):
www.rolfmunke.se/index.php/component/gur...-utvecklas-pa-gymmet
Hi, Bosse.
It's because there are shown modules (not lessons) and in courses below you have only ONE module:
www.rolfmunke.se/index.php/2016-03-25-13...-4-kg-pa-fyra-veckor
i.imgur.com/T2XG1YD.png
www.rolfmunke.se/index.php/component/gur...ed-rolf-300-000-steg
i.imgur.com/nJPbQP8.png
Here are more modules and they are displayed:
www.rolfmunke.se/index.php/component/gur...-utvecklas-pa-gymmet
i.imgur.com/e4CEutf.png
So display in each case is correct as real number of modules are shown.
What!!! GAH!!! Where the heck are the lessons???
I added 28 lesson to ALL. And now they're gone? How? What happened?
Have I made a setting to hide them? If yes, how do I make the show again?
Hi. Bosse.
The couldn't be hidden in backend.
Of course I don't touched anything in your setting - just made a printscreen what I saw.
I didn't saw it earlier so I can't tell if anything is gone...
Check your backup copy - if you have one...
All I know is nothing is happening without reason... lessons can't vanish just like that...
Hi, Bosse.
Lessons are stored in _guru_task table.
Lesson content is stored in _guru_media.
Oki. Yes, the lessons are still in the database. They just don't show up in admin or on the site.
What to do?
I just can't figure out what I could've done to cause this.
The only thing I know I did with these courses is that I renamed them.
I had manually added links in articles that pointed to the courses with the old names. When I click any of these links I get the following error:
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'and o.`userid`=c.`id` and o.`userid`=bc.`userid`' at line 1 SQL=SELECT count(distinct bc.userid) FROM zdvgw_guru_buy_courses bc, zdvgw_users u , zdvgw_guru_customer c, zdvgw_guru_order o WHERE c.id=bc.userid and bc.userid=u.id and bc.course_id= and o.`userid`=c.`id` and o.`userid`=bc.`userid`
Could that have anything to do with this?
Never the less, the lessons are there. Will you help me get them back on the site?
(I can't show any of the links that pointed to the old course names. They are now edited, for obvious reasons...)
Hi, Bosse.
Please, edit your first post and provide PHPmyAdmin credentials.
Also do a safe copy of your whole website and db.
Hi, Bosse.
Most relations are stored in _guru_mediarel
28 dagar med Rolf – 300.000 steg (course) = ID 18 (stored in _guru_program)
28 dagar med Rolf – 300.000 steg (module) = ID 22 (stored in _guru_days and related there with pid 18, that is course)
Lessons are stored in _guru_task with own ID
Relations between lessons and modules are stored in _guru_mediarel.
Relation has type dtask.
typeid = module ID
mediaid = lesson ID
In case of 28 dagar med Rolf – 300.000 steg (module) = ID 22 are no relations with lessons (no relation records).
Could you identify in _guru_task which lessons should be related with 28 dagar med Rolf – 300.000 steg (module) = ID 22?
I'm not comfortable with db stuff. I never really learned how to work it.
So I have no idea what so ever what I'm talking about below, let's hope I got what you asked for... :)
I'd really like to know what I did to cause this so I don't repeat it.
/Bosse
In guru_task I found this:
28 dagar med Rolf – 300.000 steg
Lesson 1-7 = ID 201-207
Lesson 8-28 = ID 418-438
But the other course that's gone (28 dagar med Rolf – Gå ner 4 kg på fyra veckor), I can't find at all in guru_task.
But this is what I found:
guru_program: ID 19, catid 2
guru_days: ID 23, pid 19 (the name is the old "28 dagar med Rolf - Gå ner 1 kg i veckan")
guru_media: Lessons 1-28 = ID 312-350
Hi, Bosse.
Now you need to create assignment between modules (days) and lessons (tasks) in _guru_mediarel.
I did that for first lesson in this curse, result:
www.rolfmunke.se/index.php/component/gur...ed-rolf-300-000-steg
I attach sql code in txt file. All you need now is just replace some values and execute it in db.
VALUES ('16442', 'dtask', '22', '201', '0', '0', '0', '0', '0')
16442 = this is record ID, just replace it to continuous numbers like 16443, 16444, 16445 etc.
dtask = this indicates lesson, leave it as it is.
22 = this is module (day) id.
201 = this is lesson (task) id.
Leave other numbers as they are - that is 0.
You may reorder lessons later in backend.
So there are media objects but NOT related with any lesson (task) as relation would be saved in _guru_mediarel as well along with relation between lessons and modules... If you can't find lessons in _guru_task then it means that they are just gone (?). Are you sure you can't find them? Did you used text search for tables?
If they are really gone.. then you need to create them again... or try to recover tables from backup copy.
Hi, Bosse.
This is quite easy... and a new thing to learn.
Do a safe copy of your site and db.
Just login to your PHPmyAdmin. Then:
i.imgur.com/FuIp86k.png
1. Choose your database by clicking it
2. Click on SQL button
3. Paste sql code that I sent you
4. Change values as I described above.
5. Finally click GO button lower right.
I don't know what happen as I know only the fact that there are no relation in db. It's really hard to deduct as there may be many reasons... Did they just disappeared or after you added them you didn't checked if they are fine?