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

Error creating OU blog #121

Open
penumbrante opened this issue Dec 7, 2021 · 10 comments
Open

Error creating OU blog #121

penumbrante opened this issue Dec 7, 2021 · 10 comments

Comments

@penumbrante
Copy link

Hi, I'm getting this messaje:

Duplicate column name 'firstnamephonetic'
SELECT COUNT(1) FROM (SELECT c.id, c.postid, c.title, c.message, c.timeposted,
a.id AS authorid, a.firstnamephonetic, a.lastnamephonetic, a.middlename, a.alternatename, a.firstname, a.lastname,pa.firstnamephonetic, pa.lastnamephonetic, pa.middlename, pa.alternatename, pa.firstname, pa.lastname,
p.title AS posttitle, p.timeposted AS postdate
FROM mdl_user a, mdl_oublog_comments c
INNER JOIN mdl_oublog_posts p ON (c.postid = p.id)
INNER JOIN mdl_oublog_instances bi ON (bi.id = p.oubloginstancesid)
INNER JOIN mdl_user pa on bi.userid = pa.id
WHERE bi.oublogid = ? AND a.id = bi.userid
AND p.timedeleted IS NULL
AND c.userid = ? AND c.timedeleted IS NULL) p
[array (
0 => '7',
1 => '453535',
)]
Error code: dmlreadexception

....

Duplicate column name 'firstnamephonetic'
SELECT COUNT(1) FROM (SELECT c.id, c.postid, c.title, c.message, c.timeposted,
a.id AS authorid, a.firstnamephonetic, a.lastnamephonetic, a.middlename, a.alternatename, a.firstname, a.lastname,pa.firstnamephonetic, pa.lastnamephonetic, pa.middlename, pa.alternatename, pa.firstname, pa.lastname,
p.title AS posttitle, p.timeposted AS postdate
FROM mdl_user a, mdl_oublog_comments c
INNER JOIN mdl_oublog_posts p ON (c.postid = p.id)
INNER JOIN mdl_oublog_instances bi ON (bi.id = p.oubloginstancesid)
INNER JOIN mdl_user pa on bi.userid = pa.id
WHERE bi.oublogid = ? AND a.id = bi.userid
AND p.timedeleted IS NULL
AND c.userid = ? AND c.timedeleted IS NULL) p
[array (
0 => '7',
1 => '453535',
)]
Error code: dmlreadexception

....

any idea what es causing this issue?

@jason-platts
Copy link
Member

jason-platts commented Dec 8, 2021

Sorry about this - it appears there is a bug in the recent code changes that we did not spot as it is OK on our infrastructure (postgres database).
mod/oublog/locallib.php
image

If you change line 3571 to:

$postauthornamefields = $userfieldsapi->get_sql('pa', false, 'poster', '', false)->selects;

It should fix the issue with any luck... thanks for reporting, and if there are similar errors elsewhere please update here and I can advise of a fix.

@GirlieNinja
Copy link

Can you fix this in the code and push it out to moodle.org?

@jstilwell
Copy link

Hi Jason, we're also seeing this issue on our platform. Do you just need a pull request for the proposed change in order to push up the fixed version to moodle.org?

@jason-platts
Copy link
Member

There is a new version with this fix on moodle.org now...

@michaelwayneharris87
Copy link

Hi @jason-platts, I'm having trouble finding the git commit for the current version that is on moodle.org. We like to keep track of updates by pulling the repo. It looks like the tip of MOODLE_311_STABLE still points to 2020091401. Can you point me in the right direction?

@jason-platts
Copy link
Member

Note there is no git version of the fix mentioned in this issue.... due to our git release strategy it won't turn up in github till March.

(Also the versioning on moodle.org is artificial. I had to manually increment the version as it doesn't allow you to update the download without a new version number)

@michaelwayneharris87
Copy link

Ah got it — thanks!

@nrosenquist
Copy link

Hi @jason-platts, outside of forking and editing a new repo to use for a few weeks, is there any way to pull code with this fix included via git before March? My team clones from this repo directly for our Moodle builds and this is currently a breaking issue for some clients. TY!

@michaelwayneharris87
Copy link

I second what @nrosenquist is suggesting — It would be very helpful if the code on github was up-to-date. As it is, we've had to stop cloning the github repo for our projects, which adds overhead to our workflows.

@jason-platts
Copy link
Member

I've updated github with our latest code early - hopefully this will resolve the issues you are seeing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants