Thursday, 2 February 2012< ^ >
arjan has set the subject to: Zotonic - the Erlang CMS
Room Configuration

[00:13:12] juanjo joins the room
[01:22:23] juanjo leaves the room
[08:30:57] arjan joins the room
[09:04:27] simon.smithies joins the room
[09:08:02] <simon.smithies> Hi Arjan
[09:08:30] <arjan> hi
[09:08:39] <simon.smithies> you available for a quick lesson in zotonic tinyMCE?
[09:08:44] <arjan> I can try to explain you a bit how it works
[09:08:56] <simon.smithies> that would be great
[09:08:58] <arjan> do you have a link to a page where you try to embed the images?
[09:09:12] <simon.smithies> can you see
[09:09:14] <simon.smithies> http://coolair.twigsolutions.co.nz:8000/
[09:09:31] <simon.smithies> ?
[09:09:49] <arjan> yes
[09:09:58] <arjan> but I need a specific page, with its id
[09:10:20] <simon.smithies> like http://coolair.twigsolutions.co.nz:8000/admin/edit/page_home
[09:10:23] <simon.smithies> ?
[09:10:41] <simon.smithies> admin / passw0rd
[09:11:16] <arjan> k
[09:11:21] <arjan> http://coolair.twigsolutions.co.nz:8000/api/base/export?id=page_home
[09:11:27] <arjan> that is the full dump of the rsc record
[09:11:38] <simon.smithies> haha
[09:11:41] <arjan> as you can see, there are HTML comments embedded in the body text
[09:11:54] <simon.smithies> for the image?
[09:11:55] <arjan> these get interpreted in your code
[09:12:01] <arjan> yes for the embedded images
[09:12:26] <simon.smithies> makes sense
[09:12:45] <simon.smithies> so that confirms my images are referenced in the database
[09:12:54] <arjan> these should be interpreted by tinymce and shown in the editor
[09:13:02] <arjan> but they are not currently, which is strange
[09:13:13] <simon.smithies> something funny happening client side?
[09:14:18] <arjan> it seems so
[09:14:24] <arjan> no javascript errors of any kind...
[09:14:32] <simon.smithies> more a general zotonic question:
[09:15:22] <simon.smithies> is the content of that dump a combinaiton of multiple resources? or is the page really all stored together in a single "field"?
[09:15:52] <simon.smithies> I don't know much about these kinds of databases
[09:16:02] <simon.smithies> relational kind of guy I am
[09:16:08] <arjan> the dump consists of 2 parts, "rsc" and "edges"
[09:16:20] <arjan> "rsc" is stored in a single row, in the rsc table
[09:16:30] <simon.smithies> understand
[09:16:32] <simon.smithies> cool
[09:16:50] <arjan> 1 moment
[09:18:25] <arjan> ok
[09:18:30] <arjan> edges are stored in the edge table
[09:18:35] <arjan> those are the page connections
[09:18:44] <arjan> 1 row for each edge between 2 rsc's
[09:19:05] <arjan> but the information in the rsc table is stored in a for humans unreadable manner
[09:19:18] <arjan> for the most part
[09:19:26] <arjan> this is the "props" field in the rsc table, serialized erlang term
[09:19:36] <arjan> this holds the body text, amongst others
[09:19:46] <arjan> basically every rsc field there is
[09:23:18] <simon.smithies> are you saying the human-unreadable rsc content is in the props field?
[09:24:06] <arjan> no the props field is *un*readable
[09:24:25] <arjan> but that's where the dump API call comes in
[09:24:51] <simon.smithies> am looking now - it /is/ unreadable!
[09:25:19] <arjan> :)
[09:25:36] <arjan> but about the embedding of the images,
[09:25:55] <arjan> it seems to work, besides the fact that the images do not get shown in the editor again after a page reload
[09:25:57] <simon.smithies> sorry to digress ... yep
[09:26:06] <simon.smithies> yep
[09:26:14] <arjan> if you change the embedding properties of an image, it is reflected in the frontend
[09:26:16] <arjan> after saving
[09:26:29] <simon.smithies> not for me
[09:26:44] <simon.smithies> I couldn't get sizes to work
[09:26:46] <arjan> for instance, I now added 1 image to the homepage,
[09:26:50] <arjan> oh
[09:27:01] <simon.smithies> i see - and aligned it right
[09:27:04] <simon.smithies> good
[09:27:33] <arjan> you're right, the size stays 100px
[09:27:39] <simon.smithies> I see you set it to size large
[09:28:04] <arjan> yes
[09:28:19] <simon.smithies> unless the "large" behavior is to not exceed the source image size?
[09:28:53] <simon.smithies> but when I load a big image, I can't make it smaller either
[09:29:42] <arjan> did you create your own _body_media.tpl file by any chance?
[09:30:12] <arjan> if not, please open modules/mod_base/templates/_body_media.tpl
[09:30:17] <arjan> and add to the top:
[09:30:19] <simon.smithies> I recognise the name of that file ... I may have
[09:30:20] <arjan> {% print size %}
[09:32:19] <simon.smithies> there is no _doby_media.tpl in my site's templates folder
[09:32:33] <arjan> it's so strange, I'm running zotonic master as well, and the tinymce works as it should, images loading and all
[09:32:39] <simon.smithies> so I added the line to modules/mod_base/templates/_body_media.tpl
[09:33:15] <arjan> I dont see it showing up yet on http://coolair.twigsolutions.co.nz:8000/
[09:33:29] <simon.smithies> flush?
[09:33:36] <arjan> you can try that
[09:33:44] <arjan> but it might mean there is another _body_media.tpl in the way
[09:34:21] <simon.smithies> you know I did mess round with that file I think - ages ago - trying to understand how to influence the small/medium/large settings
[09:34:33] <simon.smithies> maybe I left some crap in there :(
[09:34:38] <arjan> is your "git status" clean?
[09:35:00] <simon.smithies> let me check ... is that the command?
[09:35:02] <arjan> just paste it here
[09:35:03] <arjan> yep
[09:35:45] <simon.smithies> modified: modules/mod_base/templates/_body_media.tpl
[09:36:05] <arjan> ah
[09:36:07] <simon.smithies> but that would be {% Print %} in the top of the file
[09:36:13] <arjan> try git diff
[09:38:16] <simon.smithies> heaps
[09:38:21] <simon.smithies> of diffs
[09:39:24] <arjan> in that file?
[09:39:31] <arjan> git diff modules/mod_base/templates/_body_media.tpl
[09:40:17] <simon.smithies> git diff modules/mod_base/templates/_body_media.tpl
diff --git a/modules/mod_base/templates/_body_media.tpl b/modules/mod_base/templ
index 6575245..eb2df22 100644
--- a/modules/mod_base/templates/_body_media.tpl
+++ b/modules/mod_base/templates/_body_media.tpl
@@ -1,3 +1,4 @@
+{% print size %}
{% ifequal align "block" %}
{% ifequal m.rsc[id].medium.mime "text/html-video-embed" %}
<section class="video-wrapper">
[09:41:06] <arjan> ok, not much there
[09:41:45] <arjan> can you try:
[09:41:48] <arjan> find -L . -name _body_media.tpl
[09:42:35] <simon.smithies> $ find -L . -name _body_media.tpl
[09:43:05] <simon.smithies> is there for coolair site, but only in a .bak folder
[09:44:48] <simon.smithies> and that one looks identical to the core one apart from the top line
[09:45:36] <arjan> template: {compile,"_body_media.tpl", "/home/zotonic/zotonic-0.8/zotonic/priv/sites/coolair/templates/_body_media.tpl"}
[09:45:57] <arjan> I enabled template compilation tracing on your site
[09:46:07] <arjan> in the development module
[09:46:17] <arjan> what's in this file? /home/zotonic/zotonic-0.8/zotonic/priv/sites/coolair/templates/_body_media.tpl
[09:47:09] <simon.smithies> -bash: template:: command not found
[09:47:21] <arjan> if you 'cat' it
[09:48:06] <simon.smithies> cat: /home/zotonic/zotonic-0.8/zotonic/priv/sites/coolair/templates/_body_media.tpl: No such file or directory
[09:48:12] <arjan> ok weird
[09:49:43] <simon.smithies> but the file doesn't exist there ...
[09:49:44] <arjan> try removing the file from the .bak folder
[09:49:55] <arjan> maybe there is something very strange happening
[09:50:13] <simon.smithies> done
[09:50:14] <arjan> I need to run an errand
[09:50:16] <arjan> ok
[09:50:18] <simon.smithies> ok
[09:50:48] <simon.smithies> one thing - this issue is on my other server where there is no .bak folder
[09:50:53] <simon.smithies> too
[09:51:12] <arjan> still it sees this one: template: {compile,"_body_media.tpl", "/home/zotonic/zotonic-0.8/zotonic/priv/sites/coolair/templates/_body_media.tpl"}
[09:51:40] <arjan> be back in 20 minutes
[09:51:45] <simon.smithies> cool :)
[10:09:43] <arjan> I'm really out of options for what's going on there
[10:09:46] <arjan> :-/
[10:10:08] <arjan> as a last resort could you give me shell access to the zotonic account so I can look at your setup in more detail?
[10:11:50] <simon.smithies> I've just realised I've been looking on my local machine for _body_media.tpl
[10:12:02] <simon.smithies> but the site you're looking at is ona remote server
[10:12:06] <simon.smithies> doh
[10:12:41] <simon.smithies> will send you shell access to the remote server
[10:13:11] kaos joins the room
[10:13:57] <arjan> ok
[10:14:03] <arjan> that might clarify things, thanks
[10:15:07] <simon.smithies> really not thinking straight ...
[10:15:39] <simon.smithies> mailed you the ssh details ... and copied github :P
[10:17:12] <simon.smithies> it is there on ther server
[10:17:14] <simon.smithies> !
[10:19:28] <simon.smithies> there is a copy of _body_media.tpl in the site templates on the server
[10:23:08] <arjan> that explains
[10:23:32] <arjan> try the {% print size %} there to see what's happening, or if the file resembles the original _body_media.tpl at all
[10:24:16] <simon.smithies> done
[10:24:30] <simon.smithies> looks like the right numbers
[10:25:36] <arjan> password does not work
[10:25:44] <arjan> :-/
[10:26:05] <simon.smithies> let me confirm
[10:27:08] <simon.smithies> has a space in front of it
[10:27:35] <arjan> ah
[10:27:37] <arjan> cool
[10:27:44] <arjan> never used a password with a space
[10:28:06] <simon.smithies> didn't realise I had either ... always copy/paste from a pasword generator ...
[10:28:58] <simon.smithies> I think a longer one with less weird characters might work better
[10:29:01] <arjan> anyway,
[10:29:19] <arjan> the bodymedia tpl does not use the given sizes
[10:29:28] <simon.smithies> !
[10:29:30] <arjan> the one that's in the coolair templates
[10:29:53] <arjan> its media tags should read somethign like:
[10:29:56] <simon.smithies> o dear
[10:30:03] <arjan> {% media m.rsc[id].medium width=size.width height=size.height crop=crop class=align link=link alt=m.rsc[id].title %}
[10:30:04] <simon.smithies> means it's my fault
[10:30:14] <arjan> on your server they read:
[10:30:17] <arjan> {% media m.rsc[id].medium crop=crop class=align link=link alt=m.rsc[id].title %}
[10:30:22] <arjan> e.g. missing width/height :P
[10:30:29] <simon.smithies> aaargh
[10:30:41] <arjan> :)
[10:30:43] <arjan> no worries
[10:31:03] <simon.smithies> and of course updating from git is not going to overwrite my templates
[10:31:31] <simon.smithies> so I can just delete _body_media.tpl from coolair?
[10:32:14] <arjan> yup
[10:32:24] <arjan> and then rescan templates + flush
[10:32:43] <arjan> but this still does not solve the issue of the images that are not loading in tinymce
[10:32:51] <simon.smithies> true
[10:33:10] <simon.smithies> geez hope that's not something I've screwed up too
[10:33:32] <arjan> no your checkout looks clean
[10:33:56] <arjan> I'm on the same branch and it works locally
[10:34:42] <arjan> I'm heading out to my office and will continue to look at it
[10:34:45] <arjan> brb
[10:34:54] <simon.smithies> thanks for the help!
[10:35:03] <simon.smithies> I'll still be here
[10:35:53] arjan leaves the room
[10:46:04] arjan joins the room
[10:49:12] <arjan> simon.smithies: debugging right now
[10:49:21] <arjan> zotonic@vps200:~/zotonic-0.8/zotonic/modules/mod_base/lib/js/modules/tinymce3.4.7/plugins/zmedia$ vi editor_plugin.js
[10:50:16] <simon.smithies> ok
[10:51:35] <simon.smithies> has that changed since 2.7.3?
[10:51:43] <simon.smithies> sorry 0.7.3
[10:51:54] <simon.smithies> which is when I think it was lat working?
[10:52:52] <arjan> yes we're keeping the tinymce up to date
[10:52:59] <arjan> and we developed 3 custom plugins
[10:53:07] <arjan> they need to be tweaked for each new tinymce version :-/
[10:53:26] <arjan> it seems that the latest tinymce strips tags which it considers "empty"
[10:53:33] <arjan> i now reproduced it locally
[10:53:40] <simon.smithies> :)
[10:53:52] <arjan> fix in the making :)
[10:54:00] <simon.smithies> so media comments getting stripped?
[10:54:42] <arjan> yep
[10:54:53] <arjan> but only when there is no content after them
[10:55:07] <simon.smithies> Ah!
[10:55:18] <arjan> so if you add an extra paragraph after the image, it works
[10:55:24] <arjan> (which was why i could not find your bug)
[10:56:40] <simon.smithies> hmmm ... just tried that with a single line para after the image
[10:56:46] <simon.smithies> still got stripped
[10:58:08] <simon.smithies> not sure having a paragraph after the image is sufficient to prevent it ... happening
[10:58:25] <simon.smithies> but shouldn't matter with your fix!
[10:59:52] <simon.smithies> this problem has nothing to do with my original issue does it. Complete coincidence.
[11:01:48] <arjan> indeed
[11:02:00] <arjan> I actually remember fixing this a while back :-/
[11:02:04] <arjan> it is an issue in tinymce
[11:03:47] <simon.smithies> It's encouraging to know: of my two biggest zotonic problems by far, one was caused totally by me (media_dimensions not working) and one is a tinyMCE problem
[11:03:58] <simon.smithies> which will be fixed in moments ;)
[11:04:33] <simon.smithies> it's a good platform
[11:06:05] <arjan> thanks :)
[11:07:19] <arjan> http://www.tinymce.com/develop/bugtracker_view.php?id=4558
[11:07:48] <simon.smithies> I see
[11:08:02] <simon.smithies> so I need to add content to the same div the image is in
[11:08:13] <simon.smithies> as a workaround
[11:08:25] <arjan> no I actually patched tinymce
[11:08:35] <arjan> but since we since then updated it, we lost my patch
[11:08:44] <simon.smithies> ah I see
[11:08:45] <arjan> digging in history...
[11:08:52] <simon.smithies> is tinymce open source?
[11:09:00] <simon.smithies> can you submit your fix to them?
[11:09:15] <kaos> Hi, Arjan, sorry to interfere... I'm running into a lists:flatten bug (passing a binary to it...)
[11:09:35] <kaos> If I recall correctly, wasn't there a bunch of fixes regarding this some time ago...
[11:09:49] <kaos> (I'm looking at mod_signup at the moment)
[11:10:18] <kaos> I'll dig a bit to see if I find it....
[11:10:48] <arjan> simon.smithies: they should first react to the ticket I guess; the patch is only 1 line
[11:11:43] <arjan> since there are 29 pull requests open they don't seem very active on fixing things...
[11:11:49] <arjan> but I'll try to submit it
[11:12:32] <simon.smithies> good luck - easier than merging it back in every time you take an upgrade
[11:12:54] <arjan> true
[11:16:28] <kaos> arjan: what you could do is have a tinymce fix branch, which you apply each time you upgrade tinymce in master.... that way you can keep score of all fixes for tinymce in one place, apply them in one go, and see any conflicts to resolve too...
[11:22:47] <simon.smithies> hey I have work in the morning ... will leave you 2 to it.
[11:22:57] <simon.smithies> Arjan thanks heaps for all the help.
[11:23:04] <arjan> no problem
[11:23:09] <arjan> I pushed the fix to zotonic
[11:23:19] <simon.smithies> champion. thanks
[11:23:19] <arjan> now doing the pull request
[11:23:35] <simon.smithies> onto my server?
[11:24:32] <arjan> I did the git pull for you
[11:24:48] <simon.smithies> the service is pretty good round here ;)
[11:24:51] <arjan> seems to work
[11:25:09] <simon.smithies> I'll try it
[11:25:47] <kaos> this is proably the commit I'm referring to...
commit d88b4361aeb7cd09a503a9b214bb7c48b2229414
Author: Marc Worrell <marc@worrell.nl>
Date: Mon Nov 14 10:32:08 2011 +0100
to_list/1 shouldn't flatten a list, to_flatlist/1 should.
[11:26:41] <simon.smithies> arjan: tested - works a charm :) thanks
[11:26:47] <arjan> :)
[11:27:16] <kaos> which isn't really what I remebered it to be.. but it hints that a fix for mod_signup would be to call to_list/1 or use z_convert:to_flatlist/1... (or see why z_dispatch:url_for/3 returns binary...)
[11:27:49] <simon.smithies> goodnight
[11:27:56] <arjan> cu!
[11:27:57] simon.smithies leaves the room
[11:28:39] <arjan> yes URLs now return a binary instead of a list
[11:28:50] <arjan> that has changed some time ago
[11:29:28] <kaos> ok. So perhaps mod_signup doesn't need to call flatten any more.. ?
[11:29:54] <kaos> from here:
observe_signup_url(#signup_url{props=Props, signup_props=SignupProps}, Context) ->
CheckId = z_ids:id(),
z_session:set(signup_xs, {CheckId, Props, SignupProps}, Context),
{ok, lists:flatten(z_dispatcher:url_for(signup, [{xs, CheckId}], Context))}.
[11:35:13] <arjan> I think you're right indeed
[11:36:34] <kaos> yep. just tried it, seems to work now :)
[11:36:40] <kaos> I'll push it
[11:37:05] <arjan> awesome :)
[11:42:04] arjan leaves the room
[11:43:13] arjan joins the room
[11:54:00] <kaos> wow, wasn't aware that unpublished pages has a slightly lighter color in the pages overview than published ones... :)
[11:54:14] <arjan> heheh
[11:54:17] <arjan> that's very subtle
[11:54:20] <arjan> depends on your monitor
[11:54:35] <kaos> subtle indeed :)
[11:55:15] <kaos> perhaps have another column with some icons for published, featured and visibilty... I find myself browsing the edit form just to check those... and visibilty is always collapsed, making it a real hassle...
[11:55:19] <arjan> I just added lager as submodule for better logging
[11:55:33] <kaos> Ah, so that is what that was ;)
[11:55:36] <arjan> true
[11:55:59] <kaos> just spotted it the other day
[11:56:24] <arjan> yeah I made a mistake actually
[11:56:29] <arjan> did not plan to commit it yet
[11:56:41] <arjan> but the submodule sneaked in with another fix
[11:56:46] <kaos> ah.. been there a few times :)
[11:57:29] <kaos> do you have any discussions regarding auth and groups?
[11:57:58] <kaos> I'm banging my head how to best implement some generic way to handle acl's for different groups of users
[11:58:13] <kaos> depending on the rsc...
[12:00:11] <arjan> that is indeed something that would be very nice to have
[12:00:23] <arjan> there is the concept of "owner id" in a rsc,
[12:00:38] <arjan> although that does not work for groups..
[12:01:31] <arjan> we might introduce a concept called "content groups"
[12:01:37] <arjan> orthogonal to the categorization
[12:01:57] <arjan> members could have read and/or write access to those groups
[12:02:06] <kaos> Yeah. And the visibilty has the "group" option... but no way to specify which group, since there are no groups
[12:02:11] <arjan> indeed :)
[12:02:20] <arjan> but then there are several questions:
[12:02:31] <arjan> - can an rsc belong to multiple groups or only to one?
[12:02:32] <kaos> sounds like what I'm looking for
[12:02:45] <arjan> - does groups have hierarchies just like categories, or are flat?
[12:02:50] <kaos> I'd say a single group per rsc is fine
[12:03:02] <arjan> - what content group does an rsc initially assigned in to?
[12:03:08] <kaos> I'd like hierarchies of groups ;)
[12:03:31] <arjan> hierarchies are nice to have indeed
[12:03:49] <kaos> unless given, say "no group", undefined. Handled as those we have now...
[12:04:19] <arjan> indeed
[12:04:25] <arjan> the group with the name "no group" :P
[12:04:40] <kaos> like the acl_role for new members :)
[12:05:44] <arjan> yes
[12:06:07] <kaos> I'll look into it some more tonight. I'd love to see this happen.
[12:06:40] <arjan> I think users must have multiple groups
[12:07:06] <arjan> maybe 2 predicates: can_read_group and can_write_group
[12:07:13] <arjan> user -> can_write_group -> editorial
[12:07:15] <arjan> etc.
[12:07:45] <arjan> I think it's fairly easy to make this into a custom ACL module
[12:07:54] <arjan> mod_acl_groups :)
[12:08:04] <kaos> awesome :D
[12:08:05] <arjan> with a hierarchical m_group just like m_category,
[12:08:30] <arjan> but based on or extending mod_acl_simple_roles
[12:09:06] <kaos> I noticed you can stack acl modules, which seems like a possible way of extending acl_simple_roles...
[12:09:37] <kaos> was that was you meant, perhaps?
[12:09:45] <kaos> what*
[12:10:42] <arjan> yes but it might complicate the interface
[12:10:55] <kaos> true
[12:11:45] <arjan> but maybe it's enough to keep using simple roles,
[12:12:39] <arjan> the acl configuration does only specify the categories which are applicable
[12:13:07] <arjan> we need 2 predicates from ACL to group: read and write.
[12:13:21] <arjan> so not user -> can_write_group -> editorial like i said, but acl -> can_write_group -> editorial
[12:14:21] <arjan> but then if you want to create groups on the fly, you also need to create acls on the fly
[12:14:41] <arjan> which might be overkill and configuration hell
[12:33:01] <kaos> Yes, lets avoid that, if possible.. ;)
I have this scenario: A bunch of projects (each project is a rsc), with members (users). Only members of a project should be able to edit this rsc, as well as rsc's related to that project (artifacts of the project, such as tasks etc). Also, there may be another group of users for the project (i.e. project admins) with an extended set of permissions..
[12:33:52] <kaos> I'm sure Marc et al already have tackled this at max class. but perhaps their solution is too specific and integrated with the rest of the max class code base...
[12:37:16] <arjan> yes indeed
[12:37:22] <arjan> It might be good inspiration though
[12:37:35] <arjan> your use case works well with the implementation I described above, I think
[12:37:49] <arjan> except for the dynamically adding/removing of acl rules, that might be hairy
[12:38:07] Juan Jose Comellas joins the room
[12:38:36] Juan Jose Comellas leaves the room
[12:46:15] <kaos> yes, I'd like to be able to specify acl rules once, then map them onto each project. Where each project is it's own user-joinable group.
[12:46:27] <kaos> or something like that...
[14:39:52] <arjan> woot, tinymce pull request has been merged :)
[14:39:55] <arjan> https://github.com/tinymce/tinymce/pull/108
[14:51:54] arjan leaves the room
[16:25:27] maas.maarten.zeeman joins the room
[16:29:33] arjan joins the room
[18:00:11] arjan leaves the room
[19:27:41] arjan joins the room
[20:22:05] juanjo joins the room
[20:22:09] juanjo leaves the room
[20:22:51] juanjo joins the room
[20:23:21] juanjo leaves the room
[20:28:51] juanjo joins the room
[20:28:57] juanjo leaves the room
[20:41:10] juanjo joins the room
[20:41:14] juanjo leaves the room
[21:11:19] juanjo joins the room
[21:11:24] juanjo leaves the room
[21:18:36] maas.maarten.zeeman leaves the room
[21:41:28] juanjo joins the room
[21:41:33] juanjo leaves the room
[22:09:31] kaos leaves the room
[22:11:37] juanjo joins the room
[22:11:42] juanjo leaves the room
[22:41:46] juanjo joins the room
[22:41:51] juanjo leaves the room
[23:11:55] juanjo joins the room
[23:11:59] juanjo leaves the room
[23:35:32] arjan leaves the room
[23:42:04] juanjo joins the room
[23:42:09] juanjo leaves the room
Powered by ejabberd Powered by Erlang Valid XHTML 1.0 Transitional Valid CSS!