MyBB Community Forums

Full Version: Patches 1.5
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8
Can you reproduce this breakage behaviour? I can't imagine what would cause it. Other than PHP hitting some time limit or memory contraint or similar during execution or the download just getting interrupted by unreliable network or something. For arbitrary data structures it could also be a recursion limit, but the depth of the patches structure is limited so that can't be it either.
Can I ask what are the limitations of this plugin? I mean, this plugin can edit all mybb files? .css, .php, .js, etc?

Also, is it possible to edit plugin's php files?
I believe you can modify absolutely eveything, yes. It really is a must have for anybody modifying core files.
The limitation is that this plugin uses /* */ style comments to mark the lines that were inserted / modified. So it can modify any code that understands these kind of comments. It was made with PHP and maybe JavaScript in mind, but CSS should work as well (although global.css is generated and frequently overwritten my MyBB's theme system so you should make changes there instead). And yes, it can edit plugin files. PluginLibrary has an example plugin that edits itself this way.

Another limitation is that the edits are line based. You can not modify only part of a line. Usually this is not a problem but for minimized JavaScript or obfuscated PHP code.

Yet another limitation is that this just isn't as powerful as real patches (GNU diff / patch). There's no line numbers and no context that could help this plugin find the right place to make modifications. So it only works if the search pattern actually exists, is unique, and if the affected code wasn't moved / changed in a way that makes the edit invalid.
I ask because I tried editing a plugin and a error showed up,

Quote:Another limitation is that the edits are line based. You can not modify only part of a line.

Maybe this is the mistake I did.

Thanks for answering, both of you Smile
What error? The file needs to be writable, that's all.
(2011-09-09, 09:01 PM)frostschutz Wrote: [ -> ]What error? The file needs to be writable, that's all.

I mean that I tried editing a part of a line and not the whole line, maybe that was the reason for the error.
While trying to change a password of an user I have got the error message that inc/languages/deutsch_du/patches.lang.php is missing.
However, the plugins only language file is placed in the admin-folder!? I copied the language-file into deutsch_du as well and changing the password worked.

Any idea what the reason for this error-message can be?
(2011-09-09, 09:29 PM)Omar G. Wrote: [ -> ]
(2011-09-09, 09:01 PM)frostschutz Wrote: [ -> ]What error? The file needs to be writable, that's all.

I mean that I tried editing a part of a line and not the whole line, maybe that was the reason for the error.

you need to operate on the whole line as that is the way patches comments out the code changes.
(2011-11-12, 04:33 PM)pavemen Wrote: [ -> ]
(2011-09-09, 09:29 PM)Omar G. Wrote: [ -> ]
(2011-09-09, 09:01 PM)frostschutz Wrote: [ -> ]What error? The file needs to be writable, that's all.

I mean that I tried editing a part of a line and not the whole line, maybe that was the reason for the error.

you need to operate on the whole line as that is the way patches comments out the code changes.

Yes I know that already, thanks Toungue

(2011-11-12, 04:31 PM)Jockl Wrote: [ -> ]While trying to change a password of an user I have got the error message that inc/languages/deutsch_du/patches.lang.php is missing.
However, the plugins only language file is placed in the admin-folder!? I copied the language-file into deutsch_du as well and changing the password worked.

Any idea what the reason for this error-message can be?

I donĀ“t know the reason but that happens many times in one of my forums that I installed using the spanish installer (I used the english installer in the other one and this had never passed), I think it only happens in that cases.
Pages: 1 2 3 4 5 6 7 8