#2819 closed Documentation (fixed)
How to migrate 1.7 plugins to 1.8
| Reported by: | dannyl | Owned by: | cash |
|---|---|---|---|
| Priority: | normal | Milestone: | Elgg 1.8 Beta 2 |
| Component: | Documentation | Version: | 1.7 |
| Severity: | major | Keywords: | |
| Cc: | brett@… | Difficulty: |
Description
Trying to get a running start on 1.8
Seems to be a lot of structural change.
I installed the 1.8 branch from the nightly (25/1/2011) and I'm trying to migrate our plugins. So far - without much luck
Is there a developers guide for the migration?
Explaining the changes in directory structure and APIs?
For example:
It seems that 1.8 uses a convention of views/default/layout/shells/
and 1.7 uses a convention of views/default/canvas/layouts/
It seems that 1.8 has a different (perhaps incompatible) way of managing the river - since after the upgrade - user comments on group Posts are appearing as river create group events (which is a bug)
Then there are the API changes - I am getting in the river error messages related to getSubject() and getObject() - these methods don't exist - I'm not sure that they have existed for a long time but now they bite the installation.
What is the appropriate migration for getSubject() and getObject?
Thanks!
Attachments (1)
Change History (23)
comment:1 Changed 2 years ago by cash
comment:2 Changed 2 years ago by dannyl
Cash
Sure. Just trying to get a head start. The trigger was actually something stupid - I needed a count of river items for a particular subtype for pagination and I noticed that the 1.8 branch had implemented count in elgg_get_river so I said why not give it a spin.
Famous last words ;-)
Danny
comment:3 Changed 2 years ago by dannyl
Cash
One more thing.
I think I have modernized all our api calls to elgg_* but we still have calls to getObject in the 1.7 river views which won't work in 1.8 and it would be nice to replace the old calls with new 1.8 compatible calls - they are localized in groups/river/forumpost/create and blogs/annotate and a couple other places.
comment:4 Changed 2 years ago by dannyl
and thanks for the great work!
D
comment:5 Changed 2 years ago by cash
ElggRiverStatement::getObject() and ElggRiverStatement::getSubject() date back to Elgg 1.0-1.2. Elgg 1.5 replaced ElggRiverStatement by passing a plain old stdClass object. Given our policy of supporting deprecated functions for two versions, I don't think we are going to include a backwards compatible version for getObject() and getSubject().
I don't think the blog,annotate river view has been used since Elgg 1.5 and should have been removed. Do you have anything in your river table that uses it?
I checked the 1.7 branch for forum/create and it uses:
$performed_by = get_entity($vars['item']->subject_guid);
instead of
$subject = $vars['item']->getSubject();
We definitely want to maintain backward compatibility so if you see some place where we are breaking it, let us know.
When we are closer, I'll share the upgrade guide with you as a preview. It would be great to have someone else work through it as a check.
comment:6 Changed 2 years ago by dannyl
Cash
Please share the upgrade guide - i'm sure it will save a lot of time.
If I may suggest - it would be a good thing to put build version numbers and revision date into the project files, especially the engine/lib files - like 1.8.2819 20100125 - this would definitely help developers pinpoint hot spots of change.
comment:7 Changed 2 years ago by ewinslow
- Milestone changed from Needs Review to Elgg 1.8
comment:8 Changed 2 years ago by cash
- Component changed from Core to Documentation
comment:9 follow-up: ↓ 10 Changed 2 years ago by dannyl
Is there somewhere I can download the upgrade guide?
comment:10 in reply to: ↑ 9 Changed 2 years ago by cash
Replying to dannyl:
All we have is a really rough Google doc. Documentation efforts have been going into preparing for GSoC lately. The only thing we've published so far is here: http://blog.elgg.org/pg/blog/cash/read/166/updating-17-plugins-for-18-while-still-using-17
comment:11 Changed 2 years ago by cash
- Milestone changed from Elgg 1.8.0 to Elgg 1.8 Beta 2
comment:12 Changed 2 years ago by cash
I updated the doc for the change in 'owner' to 'all'. We don't explicitly mention the summary view by name so Evan's modification does not affect the doc. What's the release mechanism here? Blog post with a link to the Google doc?
comment:13 Changed 2 years ago by cash
- Owner set to cash
- Status changed from new to assigned
comment:14 Changed 2 years ago by ewinslow
I'd prefer it go on the wiki first
comment:15 Changed 2 years ago by cash
If no objections, I'll the current doc to the wiki. Let me know by end of the day.
comment:16 Changed 2 years ago by brettp
Wiki sounds good.
comment:17 Changed 2 years ago by cash
I tried to save it as an ODT file and then use OO to export as a MediaWiki txt file (thought that would be so much easier than reformatting the text). I do Java development and I guess my JVM breaks the OO MediaWiki export extension.
comment:18 Changed 2 years ago by brettp
Where's the OO extension? I can try to export as MediaWiki txt.
comment:19 Changed 2 years ago by cash
http://extensions.services.openoffice.org/project/wikipublisher
It adds an "export to" option and maybe even a direct post to wiki.
comment:20 Changed 2 years ago by brettp
Nifty. Attachment incoming.
Changed 2 years ago by brettp
comment:21 Changed 2 years ago by cash
- Resolution set to fixed
- Status changed from assigned to closed
Thanks much, Brett. That saved me a lot of time. The only thing I had to adjust were the quote mark characters and one trashed link.
comment:22 Changed 2 years ago by arsalan
Sound like interesting if there is Built in Legacy Plugin That Work Elgg 1.7 plugins/mod in Elgg 1.8

Danny - can you give us some more time on 1.8 before you start migrating?
I have written a short guide to updating plugins that I plan to add to by migrating a few plugins. We will publish that.