Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#121 2011-06-21 06:27:08

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: [plugin] [ORPHAN] cnk_versioning

artagesw wrote:

It seems that the plugin simply reads/writes a shared file system on the server instead of the database.

It auto-imports the files to the database from the file system. Also it disables the admin-interface that would allow editing presentation related items.

But how does it prevent overwrites or conflicts between multiple authors? How do you provide multiple authors with access to this shared space without conflicts?

It doesn’t, but version control system. Commonly no one edits the shared production files directly, but has their own checkouts and commits to the repository. Then from the repository the code is auto-deployed to the production environment when proven stable. As version control system is used, no overwrites are possible and changing the code is safe.

Last edited by Gocom (2011-06-21 06:56:43)

Offline

#122 2011-06-21 07:31:11

artagesw
Member
From: Seattle, WA
Registered: 2007-04-29
Posts: 227
Website

Re: [plugin] [ORPHAN] cnk_versioning

Gocom wrote:

It doesn’t, but version control system. Commonly no one edits the shared production files directly, but has their own checkouts and commits to the repository.

OK, so am I correct to assume that this model also requires each author to run their own instance of Textpattern, which reads/writes to their own checkout directory?

Offline

#123 2011-06-21 08:33:53

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: [plugin] [ORPHAN] cnk_versioning

artagesw wrote:

OK, so am I correct to assume that this model also requires each author to run their own instance of Textpattern, which reads/writes to their own checkout directory?

Sam, I don’t really understand what you mean by reading and writing, sorry. Cnk_versioning just imports files to database. It doesn’t write anything, apart from exporting feature it offers. Updating the files doesn’t require TXP as updating isn’t done from TXP.

If a person, a developer, wants to test changes locally, then yes, they would have their own Textpattern install as usually the Textpattern side of the team have. That goes without saying. One can also use centralized testing/staging servers where the changes are deployed. What ever works best for the team.

I read that by authors you refer to the content editors, end-users. Content editors usually don’t touch the code, if that isn’t what they are responsible for. Those that are not required to touch the code, shouldn’t have to touch code (if they don’t want to). They don’t need to have access to the forms and usually neither have to use the VCS. Everyone uses what’s best for them, and content authors use the easy to use GUI, Textpattern’s admin-interface. Dev team do the tools and content authors do content.

Offline

#124 2011-06-21 10:47:50

AdamK
Member
From: Kraków, Poland
Registered: 2009-08-11
Posts: 47

Re: [plugin] [ORPHAN] cnk_versioning

jstubbs wrote:

$CNK_VER_OUTPUT_PATH = ‘public/_templates/versioning/’;

I have managed to save the files with exactly this path, which I found working after some debugging, thanx. But then TXP did not see the saved pages back (there was an error “wrong/unknown section” after reloading the page): plugin was reading from a different place than it was writing to (result: empty pages/forms/css tables in DB after reload). I had to modify

		// read all files
		$forms = glob('../'.$CNK_VER_OUTPUT_PATH.'forms/*.'.$CNK_VER_EXT);
		$pages = glob('../'.$CNK_VER_OUTPUT_PATH.'pages/*.'.$CNK_VER_EXT);
		$css = glob('../'.$CNK_VER_OUTPUT_PATH.'css/*.'.$CNK_VER_EXT_CSS);

adding ‘../’ just after glob. (just as it is in the writing procedure)

Ok, now it was reading the files, but I got another error: alternating good design with a database error:

Warning: Duplicate entry ‘default’ for key ‘PRIMARY’ insert into txp_page set name = ‘default’, user_html = ‘\n \r\n\r\n\r\n\r\n
\r\nAdam\n
\r\n\r\n\r\n\r\n\r\n\r\n’, file_mod_time = FROM_UNIXTIME(‘1308653162’) textpattern/lib/txplib_misc.php(653) : eval()’d code:179 safe_insert() in /home/me/public_html/serwisy_hostowane/textpattern/textpattern/lib/txplib_db.php on line 89

I gave up. I switch to hcg_templates, but I need to hack it just to add a button “reload last template again”.

A.

Last edited by AdamK (2011-06-21 10:50:42)

Offline

#125 2011-06-21 13:13:14

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: [plugin] [ORPHAN] cnk_versioning

Hi Adam.
On my setup, I’ve:

$CNK_VER_OUTPUT_PATH = ‘admin/’;

And that seems to work “both ways”. In any case, the “write” process has to be done just one time by cnk_versioning. Then, once files (forms/pages/css) are written, you won’t usually need to write them back to the filesystem. In other words, once the files are written, then the plugin is just there to read the files and write them back to the database, one-way only.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#126 2011-06-21 17:41:51

artagesw
Member
From: Seattle, WA
Registered: 2007-04-29
Posts: 227
Website

Re: [plugin] [ORPHAN] cnk_versioning

Gocom wrote:

Sam, I don’t really understand what you mean by reading and writing, sorry. Cnk_versioning just imports files to database. It doesn’t write anything, apart from exporting feature it offers. Updating the files doesn’t require TXP as updating isn’t done from TXP.

Reading = importing from file system to database
Writing = exporting from database to file system (initial export)

Gocom wrote:

If a person, a developer, wants to test changes locally, then yes, they would have their own Textpattern install as usually the Textpattern side of the team have. That goes without saying. One can also use centralized testing/staging servers where the changes are deployed. What ever works best for the team.

Isn’t that the whole point? That is, you have a team of developers who want to work without conflict and test their changes locally? I’m trying to understand the workflow. So, each developer creates their own local instance of Textpattern + cnk_versioning, checks out files from a central repo, and works from there. cnk_versioning would be installed on the production server only for deployment purposes. (Pull latest from the master repo, set the production status to “Testing”, refresh a front-end page to force an import, then reset to “Production.”) Sound about right?

Gocom wrote:

I read that by authors you refer to the content editors, end-users.

Sorry, no. I meant authors of design assets – i.e. developers of pages, forms and styles.

Offline

#127 2011-06-21 18:42:45

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: [plugin] [ORPHAN] cnk_versioning

artagesw wrote:

Sound about right?

Yes.

So, each developer creates their own local instance of Textpattern + cnk_versioning, checks out files from a central repo, and works from there.

I do put Textpattern and plugins to the repo (or as external repo) too. Pretty much everything is in the repos apart from site content (images, files, articles). Setting up everything for the first time is just matter of creating config file, running SQL file and cleaner script that changes all the preferences to match the used system. Nothing more.

Pull latest from the master repo, set the production status to “Testing”, refresh a front-end page to force an import, then reset to “Production.”

I go with push. VCS deployment server pushes the latest over WebDav or SFTP, with additional pinging doing the updating (or some lazy ass human called “Jukka” clicking a link – I know horrible). Fun fact; I’ve never ran a server that hosted both VCS and a web server, always separate box.

Offline

#128 2011-06-22 09:11:26

AdamK
Member
From: Kraków, Poland
Registered: 2009-08-11
Posts: 47

Re: [plugin] [ORPHAN] cnk_versioning

Ha, I did it :)

it was just a problem of finding the right path in multisite setup

instead

$CNK_VER_OUTPUT_PATH = '_templates/versioning'; 

one has to put

$CNK_VER_OUTPUT_PATH = './_templates/versioning'; 

./ points to ‘public’ (better: to $path_to_site), of course, but on my system the plugin doesn’t work without this explicit pointer

I am a happy designer now :)

A.

Last edited by AdamK (2011-06-22 09:13:58)

Offline

#129 2011-07-09 10:52:04

mmelon
Member
Registered: 2006-03-02
Posts: 95

Re: [plugin] [ORPHAN] cnk_versioning

can’t get this to work. I was getting the folders not writable error until I set the var to

$CNK_VER_OUTPUT_PATH = ‘_templates/versioning/’;

and created

/_templates

/_templates/versioning

/templates/versioning/pages

etc

all 777 above my textpattern directory.

Then it said it successfully wrote out all pages forms and css, but there is nothing appearing in the folder

and i am getting the ‘unknown section’ error

it’s like it didn’t write the templates but thought it did?

Any help?

Mike

Offline

#130 2011-07-09 11:46:50

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,726
Website

Re: [plugin] [ORPHAN] cnk_versioning

mmelon, is your production status set to testing or debugging mode?


TXP Builders – finely-crafted code, design and txp

Offline

#131 2011-07-09 12:05:36

mmelon
Member
Registered: 2006-03-02
Posts: 95

Re: [plugin] [ORPHAN] cnk_versioning

i tried both. i got it working by restoring a backup and doing download templates before i activated the install. that worked despite there being errors reported about missing database columns.

then I had the whole issue with the corrupt style sheets. so i’ve decided not to use it.

it should maybe have a front page warning about adding to live websites. very easy to wipe your entire forms templates and styles.

Offline

#132 2011-07-09 15:17:57

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,726
Website

Re: [plugin] [ORPHAN] cnk_versioning

It is unfortunately not quite up to date and not fully documented, but there is an easy fix for the css problem here with txp 4.3+.

I’ve seen that “unknown section” error on very particular occasions when trying to force an update from within the plugin when not in testing/debug mode (though it should not do anything in “live” mode).

But it is worth persisting with: make a backup first, work carefully and methodically, and you should get it going and then … you won’t want to go back to the presentation tab textareas ever again.

I’ve seen one or two fixed versions of the plugin, including one that also leaves the adi_variables form alone but I forget where. Maybe that can be rolled back into the original?


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB