We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

[Solved]How Oxwall works on plugin update when there are changes? | Forum

Mohammad
Mohammad Dec 22 '14
Hello


I am almost done with updating one of my plugin(it's free),there are some changes in plugin

1-in language file which is the langs.zip I made changes,So I need to apply this changes when user is updating plugin from admin area

2-database,I added a column to an existing table which  somehow I need to apply this on updating

My problem is NOT about how to write PHP codes,my problem is that I don't know how Oxwall works on plugin updates so I could apply this changes when user is updating


Thank you


Mohammad

The Forum post is edited by Mohammad Jan 26 '15
Mohammad
Mohammad Dec 23 '14
:) you didn't get my question

when Oxwall operate a plugin update,it surely run some special file in plugin to make sure a clean update(there are a lot of plugins which would change their langs.zip on every update),in some plugins I saw update or updates(I don't remember the exact name) directory which contains some files but I don't if that's what I needed or how it works


Mohammad
Mohammad Jan 7 '15
Any help from support ?
Mashoor Classified
Mashoor Classified Jan 8 '15
Yes i already asked Mohammad to update his plugins but its now showing in Oxwall admin panel? He already updated
Daisy Team
Daisy Jan 23 '15
Dear Mohammad,

The update process does not remove or edit existing values.

If you want to change the existing key value - you should create a new key. For example, we have language key for the notification letter:

key: base_notification_letter
value: We are glad to inform you...

If you need to change the value you should create a new key with the new value:

key: base_new_notification_letter
value: We are sorry to inform you...

If you need to add a new key, you should simply create it and then compile a new langs.zip file with all new language values and keys.

After the langs.zip file is ready you will need to create the update folder in your plugin and add your new langusge package into this plugin with the update script.

Please check the Blogs plugin to see how it works. For example check the ow_plugins/blogs/update/2867 and file it contains.
Mohammad
Mohammad Jan 23 '15
Great Answer Daisy, the instance you gave me is clear.

just one last thing,the name of parent directory  of "update.php" must match the plugin build ? 

Daisy Team
Daisy Jan 25 '15
Yes, and the build number should be greater than previous one.
dave Leader
dave Apr 25 '16
So to be clear here, 


if i have build  5 in my plugin xml file  and i have an update to the lang file and lets say one sql command. 


Then in the update folder i should have a folder also named 5  and  inside that folder then i will put my update.php file along with the lang.zip file and make sure i put the command for the zip in my update.php file as well (which i do by the way)


so it would look like this   ow_plugins/plugin name/update/5/update.php 


so that when the user gets the update the update process knows to process the 5 folder because it relates it to the build number. 


Is that correct?  



Now how about this: 


plugin xml file has build 5 however i have this...


ow_plugins/plugin name/update/update.php 


will it still update? 


Thanks 

Dave




The Forum post is edited by dave Apr 25 '16