Fantastic to distribute with a tester makefile.
-- didn't quite work as the makefile is not yet finding a 'recommended' release, but I was able to work around that for now.

Tiny niggle - I run with strict on -
Warning: Call-time pass-by-reference has been deprecated in /Library/WebServer/Documents/wysiwyg_fields_test/sites/all/modules/contrib/wysiwyg_fields/wysiwyg_fields.module on line 243
So, easy fix there..

.. oh dear, there's are a few more.

Warning: Call-time pass-by-reference has been deprecated in /Library/WebServer/Documents/wysiwyg_fields_test/sites/all/modules/contrib/wysiwyg_fields/includes/system.inc on line 39

Warning: Call-time pass-by-reference has been deprecated in /Library/WebServer/Documents/wysiwyg_fields_test/sites/all/modules/contrib/wysiwyg_fields/includes/system.inc on line 46

Hardly worth a patch when it's just a couple of characters?

On first run - hitting create-content (node/add/wf-test)
No jQuery UI theme found, please download the appropriate files from: http://blog.jqueryui.com/2010/02/jquery-ui-download-builderthemeroller-status/
... On the status page:
The jQuery UI plugin is missing. Download and extract it to your jquery_ui module directory.
Hm, I thought I saw that arrive with the makefile. Pity jquery ui doesn't use the libraries folder yet. OK, so I installed that by hand. I wonder where the drush_make version went.
(I'm using todays git checkout of drush btw)

So, sorted that out, looks promising, page editor and wysiwyg loads. Buttons show. Clicking them shows up the dialog ok.
uploading into the dialog seems to be working. But 'insert' ... doesn't get back into the textarea. :-(
Mostly nothing seems to happen (I disable rich-text to see).
Once I saw a pseudo-tag [wysiwyg_fields-field_file-0-] - but that doesn't show in the editor.
I tried all three editors, no visible difference in result.

So - I know this is first release, so it is still deep in dev, so no pressure (tagging this feedback as minor). I just thought I'd let you know how the first trial went.
I'll be watching this one! I've got something very similar happening at my end, hopefully I can merge some ideas.

CommentFileSizeAuthor
#21 patch_commit_7a165a394f08.patch7.56 KBDeciphered
#3 README.txt10.9 KBdman
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dman’s picture

Gotta say again - the install-feature setup works really well!

Deciphered’s picture

Thanks dman,
Both for the kind words and also for the excellent notes on testing.

Issues with the makefile have been fixed, though I wasn't able to reproduce the issue with jQuery UI, it installed correctly on my test. Maybe the version of Drush your using? And yes, I totally agree that jQuery UI should be using libraries.

The other issues, pass-by-reference issues, will need some attention. I have already had a case where doing them the other way caused things not to work in one testers environment, and now it appears to be the polar opposite.

Your final issue, with the formatter not being invoked correctly, is highly likely a result of the changes you made to the array_walk_recursive, which would be returning the the correct formatter to be used until you corrected the code :)

I will spend my coding time tomorrow looking into fixing all these issues for you, so expect and update within 24hours.

One question though, just to help with testing, what is your testing environment? Specifically interesting in which version of PHP you are running.

Cheers,
Deciphered.

dman’s picture

FileSize
10.9 KB

This test was on an OSX, PHP 5.2.14 - slightly home-compiled version of PHP. (where pass-by-reference is a nasty warning notice, but not full death. on 5.3 it's fatal)
With all warnings (error_reporting = E_ALL & ~E_NOTICE) printed to screen. display_errors = On

All Drupal versions as specified in the makefile.

I saw the jquery_ui lib come down the pipe when 'make' ran. Just not sure where drush stored it afterwards - can't find it now anyway. I used to run a tweaked version of drush (getting it to play nice with other makefiles) but today I'd replaced it with the freshest git version, so no surprises there?

Yes, you are quite right. if I revert to a clean distro, the UI buttons do behave like they were supposed to! !!
However, I had to turn of all error reporting on my dev machine to stop the warnings. The warnings to the screen made form submission and AJAX entirely fail.

I've had an extensive peek under the hood so far, and (when I figured it out) I think the re-use of the field subforms that happens - hiding them then revealing them in the dialog) is pretty sweet.

However, I have opinions about yet another markdown syntax and yet another pseudo tag.
I'll attach my roadmap/rant on that here, just as an opinion piece. I've been planning to share it somewhere, so it may as well be here.

In short - Why invent a tag called
<wysiwyg_field id="wysiwyg_fields-field_image-0-custom_formatters_formatter_custom_formatters_wf_img_caption" class="wysiwyg_fields wysiwyg_fields-field_image"></wysiwyg_field> when that's just non-validating html that needs to be converted out of each time you switch edit mode?
Why invent another markdown [wysiwyg_fields-field_image-1-custom_formatters_formatter_custom_formatters_wf_img_caption]
that you have to keep swapping in-and-out of? That markdown is not going to be managed by a human editor, so why 'simplify' it?
And, y'know ... a bit ugly, right?

I think (and this is just IMO of course) a syntax such as:

<div class="wysiwyg_fields wysiwyg_fields-field_image" wf:element="field_image" wf:index="0" wf:formatter="wf_img_caption"   ></div>

... can do everything you are doing, and bring along a whole bunch of advantages too.

Of course, I'm not suggesting a full re-think from your end, just sharing the direction that I'm planning to go with a thing like this (... hm, can no longer link to my cvs sandbox .. )
Anyway, I'll attach my roadmap, perhaps it contains an idea.

Deciphered’s picture

dman,

Can you try this potential fix for the array_walk_recursive() issue?

Change line #244 of wysiwyg_fields.module to:
array_walk_recursive($form_state['post'][$element['#field_name']][$delta], '_wysiwyg_fields_element_validate', array(&$field['wysiwyg_fields']['wysiwyg_fields_formatters']));

And line #255 to:
$formatter[0] = $item;

I'm having trouble getting MAMP to report the errors you are having, but the research I have done shows that this method, passing the 'pass by reference' variable inside an array apparently bypasses the error. If that doesn't work, as there's no way to change the array_walk_recursive() declaration I would have to find and alternative.

Thanks in advance for your help.

Deciphered’s picture

As for the use of the <wysiwyg_field> tag, I did do extensive testing and it was the best solution for the situation, but it is not yet set in stone as while it works perfectly with the three Wysiwyg libraries in Firefox, it doesn't yet work in all the other browsers.

<div> doesn't work in all cases because of the box model defaults, say I wrap an <img> tag with <div> the <img> would break out of the paragraph that it's inserted into, which an <img> inserted on it's own would not do.

With CKEditor and FCKEditor, wrapping a <div> with a <span> won't work, as they will try to move the <span> back inside the <div> when the Wysiwyg module fires the Detach event.

The use of the <wysiwyg_field> tag solves all these problems for CKEditor and FCKEditor, and as it's only used while in the Wysiwyg mode itself there's no issue. TinyMCE does not use the <wysiwyg_field> tag, it uses a <span>.

As for the '[wysiwyg_fields-field_image-1-custom_formatters_formatter_custom_formatters_wf_img_caption]' tag, that is simply a placeholder 'token' (not to be confused with a Token module token) that gets filtered out by the Wysiwyg Fields filter on node render, it could be any format, but I chose that format as it's the standard style for a filter token (look at the bottom of the D.o. comment form and you'll notice a similar format).

Save meaningful HTML equivalents in the stored text data, so that turning off
the filter or the module will not result in data loss, merely static versions
of the desired content.

The reason I choose not to do this is that by utilizing the filter approach it means that if the referenced CCK field is modified by an external source (another module invoking hook_nodeapi or other means) or if the formatter is changes (a Custom formatter that gets updated) the output can reflect these changes.

 

I haven't yet read through the total of your document, but it does look good and I intend to do so ASAP, but I can also assure you that I have put alot of thought and testing into Wysiwyg Fields and the majority the approaches I have taken where taken for a very good reason.

However it's great to have you testing this, you clearly seem to be on a very similar wavelength and I look forward to working with you to make this a great module.

Cheers,
Deciphered.

dman’s picture

OK, that looks like an answer.
With error-messages hushed, and your modifications above applied, things continued to work.
With error messages turned on again, I got a repeat of the first two warnings from includes/system.inc:39, includes/system.inc:46

so I re-patched those :-)

Yes, I think we have it all working. No more warnings, fully working buttons!
I think that's an ok fix. not beautiful, but gritty stuff like that isn't.

FYI, about repeating it, one of the verbose messages also gave me this hint:

Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of drupal_alter(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in /Library/WebServer/Documents/wysiwyg_fields_test/sites/all/modules/contrib/wysiwyg_fields/includes/system.inc on line 39

I didn't plan on setting 'allow_call_time_pass_reference' for my test box, but that may be your state.

Deciphered’s picture

I'll need to get the other tester to try out the changes before I commit them, because while your getting notices, which is annoying, they where getting a WSOD with the correct way of doing things, so I need to make sure to come up with a fix that works for everyone.

Hopefully I can get this issue fixed within the next 24 hours.

dman’s picture

I know what you mean with the block vs inline element choice. This is an issue I've looked at already.
I'm still expecting there will be a way to use existing semantic tags + css to behave in all the ways we need it to. The actual tag type doesn't even matter to me as I'd just be looking for <* class='wysiwyg_field'>. So a span is fine. I'd choose a specially styled span over a new 'tag' any day.

Fighting with the various editor libraries, I can sympathize with. But aren't any of them, or any xhtml-compliant browsers within their rights to just entirely discard or ignore non-validating, non-namespaced elements they find in the DOM? If the editor declares a DOCTYPE, it should be enforcing it. The fact that they currently don't seem to be strict on it seems more by luck than design. I mean, it's great that you've found that it works, but I don't trust that it should work into the future.
If you namespaced it, I'd relax a lot more.

if the referenced CCK field is modified by an external source

Yeah fully.
I'm totally keeping on with the filter approach. Yes I think that any of these remote elements can be dynamically replaced with filters. My version does the same as yours in that way
- except that my filter scans for the semantic tags and does the replace, not for the custom tokens.
What gets saved in the database is actual HTML, not pseudo-code. I like it that way.
That's largely because I'm comfortable with XML and XPATH now, and (when parsing XHTML) prefer it over regular expressions.
So just getting an element with a class is trivial - though it can be a nightmare in regular expressions.
... yes, I do my hook_filter with xpath and DOM manipulation. :-B

Deciphered’s picture

The actual tag type doesn't even matter to me as I'd just be looking for <* class='wysiwyg_field'>.

What if it was the output of a textfield, what element would you search for there? Doesn't even have to be a textfield, someone could easily write a formatter that outputs code like:

<img src='#' />Text

There has to be a wrapper, and by being an actual HTML element it means for efficient selection via standard jQuery selectors. I did throw about the idea of HTML comment wrappers, but it would required extremely inefficient searches on the Wysiwyg isNode event.

I mean, it's great that you've found that it works, but I don't trust that it should work into the future.

You're 100% right, but the choices are as such:
- Do it the way I'm doing it now and battle with every configuration, constantly playing a catch-up game.
- Use <div> tags and accept that the Wysiwyg view and the Node view will never match 100%, nor will the use get what they expect.
- Give up.

Clearly the third option is not an option at all, and the second option doesn't appeal to me very much either. This particular issue has caused me a lot of grief and no doubt will continue to do so due to the different behaviours of different browsers, but I'm happy to change it if a better option that fits all criteria is offered.

What gets saved in the database is actual HTML, not pseudo-code.

I do get where you're coming from, and I am still considering this proposal as there is still one big issue with the filter system, caching, that your option would offer a cleaner solution to fixing, but you have to remember that what's stored in the database is only relevant to the trully anal (which there's nothing wrong with at all), it doesn't effect the output in any way, nor does it effect the Wysiwyg view. If anything your version is longer and therefore less eficient.

The other downside is that technically someone would be able to write the current format by hand, allowing those not using a Wysiwyg input filter to still utilize the module. Of course they could do that with your format as well, but it could be harder to explain the syntax...

But I will give this some more thought today, because there is nothing specifically wrong with your suggestion.

Deciphered’s picture

I may have jumped the gun in my last reply, I don't think you where saying that I should use a wrapper, I think you where just saying that the wrapper used shouldn't be part of the equation. That's what you get for posting at 6:00am.

I did consider changing wrappers based on the content, but the problem is that if the output was something like:

<img />
<div>Text</div>

I would need to use a SPAN to wrap the IMG tag, but a DIV to wrap the DIV tag, so I couldn't wrap the entire code with one single element, I'd have to wrap sections, which would mean storing it as a Javascript variable during the Wysiwyg Detach event would be extremely difficult.

Again, I would love for you to tell me how to make this just work, it would make my day, but it's not an easy problem.

dman’s picture

Well, I don't have the full answer, and your discussion points are helpful in trying to highlight any weaknesses with the plan.

Yes, We always need a wrapper of some sort. Hell no to comment tags.
I'm just expecting that a div with display:inline-block is going to be mostly acceptable.

Given Drupals div-itis, encountering <img/><div>Text</div> without a wrapper div is pretty unlikely, and not a common layout thing. Why would you do that and not put a container of some sort around it? With display:inline you get whatever was needed in the layout, plus a class tag to leverage. I consider a case where you absolutely have to insert just HTML fragments without a wrapper where display:inline; won't do - to be an edge case I don't think needs supporting.

The other downside is that technically someone would be able to write the current format by hand, allowing those not using a Wysiwyg input filter to still utilize the module. Of course they could do that with your format as well, but it could be harder to explain the syntax...

Harder? I gotta disagree. One of the reasons I'm going down my track is because valid attributes make sense for anyone who is dealing with HTML, or has ever seen HTML source. There is 30 years of background to that syntax.

I can't agree that (for someone who is already in HTML code-view) that this would be easier to type, maintain and understand

[wysiwyg_fields-field_image-1-custom_formatters_formatter_custom_formatters_wf_img_caption]

... than this:

<div class="wysiwyg_fields wysiwyg_fields-field_image" wf:element="field_image" wf:index="0" wf:formatter="wf_img_caption"   ></div>

Looking at the other 20 'insert' modules that have injected pseudo-tags, they have all had to invent their own syntax. Each unique, each limited, each requiring the user to learn different syntax rules. Initially because it was 'simpler' to write [img:1]. But then they had to break, twist and extend the syntax until it was something that was so close to SGML that you wonder why they couldn't see the similarity [img_assist|nid=2|title=My title|desc=My description|align=right|width=200|height=150|link=url,http://www.google.com]

extensibility is a big one. Can you cover every possible argument in the ID token? I'm looking immediately at adding an optional 'cachelifetime' attribute to my embeds to indicate their volatility.
I like the idea that maybe it will make sense to apply styles to the item - width:45%, float:right, margin-left:1em.
By fixing on a single fixed string-based identifier so early, you may be implicitly saying "I will never add any more features to this model". I don't think that is true.

I'm looking at more than just field-embeds here, in my roadmap. If I were to do this with a views_embed type thing ... then I need space in the syntax to add arg1="2011". Not relevant to where you are going with wysiwyg_fields this week but I see a pattern there.

My preference for real markup in the real markup place may seem to be an internal issue only, but I've spent many of my dev years doing migrations in and out of HTML systems and dozens of different CMSs. The more unique tricks your 'text' has in it, the more reliant its 'content' is on the display mechanism - the less portable, the less future-proof it is. It becomes less internally consistent, less self-evident.
Just last Christmas, we had to migrate a Drupal 5 site to Drupal 6. Great, only it was using one of the many flavors of pseudo-tag, just to embed images. It turned out to be a deprecated one. This was thousands of pages of legacy content, using an input filter that wasn't available in D6.
Given that we were replacing the functionality with a (slightly) better version of the same thing, life would have been so much better if the [img|attachment:1] tag was just an <img src="..." class="img-attachment-1"> or something like that.
By looking behind, I can think ahead.

And maybe the main reason that I want to take this approach with a wysiwyg plugin - is I can avoid that 3/4 of the javascript code that does nothing except swap between various markup formats - internal token, wysiwyg-render, textview-markdown, actual-render every time you click a button. If we could stop rewriting that card-trick for each editor and concentrate on actual features I think the code would be sweeter to write.

Anyway ... all just brain-dumps. I'm not talking you into changing what currently works fine for you, just sharing where I am looking towards.

Deciphered’s picture

On the format issue, I think you've won that one. While and [img|file.jpg] format is 100 times easier for an end-user to write than an actual Image tag, my token is already too large to be realistically written by hand.

And I have already had the splitting on '-' cause a limitation for myself, so I concede.

I would be ever so grateful if you could provide a patch as it sounds as if you've already dealt with the regular expression, and I'm not a huge fan of re-inventing the wheel.

 

As for the wrapper, my intent is not to shoot down your ideas, only to show you how I have already tested those options and found there shortcomings.

And I have to do it again :(

A DIV, whether it has the style 'display: inline-block' (which I did test) or not, will break outside of a P when inserted. So if you where to insert the following code:
<img />

Into the following code:
<p>lorem ipsum dolor</p>

The Wysiwyg would make something like the following happen:
<p>lorem ipsum </p><div><img/></div><p> dolor</p>

Resulting with the node rendering something like:
<p>lorem ipsum </p><img /><p> dolor</p>

Instead of:
<p>lorem ipsum <img /> dolor</p>

One thing that I didn't mention to you, and you may not have seen in the code, is that the element wrapper can be set per Wysiwyg library and theoretically also by browser. Again I know it's not a perfect solution and not exactly good practice, but the key thing is that it does work better than any of the other methods I have attempted.

If there where some sort of element that could be used as a wrapper that was a valid element but had absolutely no defaults (box-model, etc) and was valid anywhere (inside or outside a DIV, etc) then we would be cooking with fire, but I am not aware of any such element.

 

Hopefully this isn't crushing your spirit like it nearly did mine.

dman’s picture

Category: bug » support

I would be ever so grateful if you could provide a patch as it sounds as if you've already dealt with the regular expression

I avoid the regular expression altogether! If you are limited to regexp, then the simple tokens have a huge head-start. And probably expalin why the earlier efforts went that way.
But ... I use XPATH and jquery. So the opposite is true for me!
When we HAVE jquery, forget string-splitting :-)

I don't have a patch for your module yet - but I did have a proof-of-concept of my annotated divs getting plugged into WYSIWYG+CKEditor in my CVS sandbox. Not sure how to get it out now. I'll have to sit down with git for a little while first I think.

Thanks for sharing re WYSIWYG editors vs paragraph tags. I'd not seen that. Yep, that's a poser worth looking at.
It again raises the question of what wysiwygs that helpfully 'correct' our block wrapping would do or not do with the fake tag.. Luckily it seems to be nothing?

So whatever... I said I don't care about what the element is. Maybe we can use div,span, whatever as needed? A per-formatter option. As I said, using xpath I'd just be looking for <* class='wysiwyg_field'>
It adds a new layer of settings ... true. The issue/challenge quite valid. But - but because we are building on an extensible base, issues can be overcome - I think.
... I think being able to define your wrapper element will pay off in HTML5 <aside>, <figure>, <dialog> . Having to support this option could be an early blessing!
IMO, the 'wrapper' can also be the element itself - where appropriate (excluding only your ungrouped img+text example). If a formatter does nothing but insert an image, we can go
<img src="..." class="wysiwyg_fields" wf:element="field_image" wf:index="0" wf:formatter="wf_img_100x100" />
... and still be round-trip compatible.
... This is new thoughts, I've not considered the ramifications of that fully-integrated approach. So it probably has some holes to pick also.

YES, looking for an element that is just a semantic wrapper without block or inline would be nice. I agree with your thoughts on that. Can't see it in HTML5 either.

I did see the element wrapper tag name getting set in the code, I tried tweaking it back to div to see what would break, but it seems there were a number of assumptions about the tagname elsewhere ... or I just tweaked the wrong place, it didn't have the quick result I was looking for.

Deciphered’s picture

(Un)fortunately the filter module process the code with PHP, so jQuery is not an option, and I don't believe XPATH can be used either, but I have nothing to back that up.

I could quite easily write the RegExp myself, I have written much more complex RegExp's before, I just thought you might have had the code ready to go.

 

Actually a DIV inside a P is not correct (I believe?), so the Wysiwyg is handling it the correct way. Where as the fake tag, it doesn't know anything about it (or at least that's how it appears) and therefore it doesn't do anything with it. TinyMCE does take issue with the fake tag, but it does let a SPAN wrap a DIV, hence TinyMCE using a SPAN.

This is all results from Firefox. I know that this doesn't work 100% in other browsers and will be delving into that shortly.

 

The problem with using HTML 5 (and certain css attributes (inline-block)) wrappers is that they won't work in every browser. I suspect that I will have to put a browser restriction inplace, but I will do everything possible to prevent that.

 

To change the element wrapper, you need to set a variable for the Wysiwyg library you're changing it for, otherwise it'll use the default. Check the TinyMCE javascript for an example.

 

I am curious on your plans as well, do you have a module in development of similar nature, or is this just something you have taken a swing at in the past? Are you interested in working together, potentially as a co-maintainer? You seem to know what you're talking about and have clearly thought about this same issue in the past, so let me know.

dman’s picture

Yeah, you are right that divs aren't technically allowed within Ps. It's nice to see the editor enforcing the rules there - I guess!
I'm not wanting to open up an HTML5 discussion, just throwing it out there as a progressing point to consider for selecting tags - or, to be precise, as a point against selecting any one tag.

I have big chunks of code in my sandbox.

An early imageembedder module that annotates a normal wysiwyg-safe img tag with a bunch of metadata that becomes directives to the render filter.


 * IF a found image (using normal <img src=""> tags is found to have an entry in
 * the files table as either a thumbnail or preview of an image node, then the
 * html will be extended with the extra HTML and CSS.
 *
 * IF the found image is found to have a specially named class assigned (easy
 * enough to do through the WYSIWYG or similar client-side tool) then optional
 * extra processes are performed.
 *
 * Currently supported: if the img has a class matching 'imagecache-presetname'
 * then the PRESET is rendered instead of the named image.
 *
 * EG :<img src="/sites/default/files/images/huge-screenshot.jpg" class="
 * imagecache-cropped_screenshot" >
 *
 * Becomes
 * <img src="/sites/default/imagecache/cropped_screenshot/files/images/huge-
 * screenshot. jpg" class=" imagecache-cropped_screenshot" >

Additional render options (triggered by the class on the image) do things like turn the alt tag into a caption and wrap it in a floated div.

It includes an XPATH-driver Drupal filter, and proved that worked to me. I use it here among other places.
So, round-trip pure-xhtml as semantic tags worked for me.

I can send through the hook_filter - XPath support function (it made me feel happy), but I need to push some of my sandbox public still.

This year, I'm working on ... pretty much what I've described so far. Though not local field-based like yours at all, it's currently embedding - (other nodes as full or teaser, blocks, views) using the syntax I prefer. So far I link straight to a node, setting parameters on the embed object. You set up a nodereference and embed that. I like your method better :-)
It exists, it's taken all the ideas I could collect from me README above. It's in sandbox, and last week I could have linked you to it. I just gotta get it out through git now. And, as usual, I'd like to tidy it up before then. But further work on it will be sponsored at my end - but I've been told to pause until the quote clears.

I've now learned how to write wysiwyg-compatible plugins, and as soon as I can figure out how to trigger a right-click context menu on my elements ... I'l be very happy.

Deciphered’s picture

Well any help you choose to offer will be greatly appreciated, especially that of the right-click context menu as that is in my (internalized) roadmap and something that I have yet to approach.

I would definitely be interested in your XPath filter code as well.

I am working on a demonstration of the Node Reference stuff at the moment, Node Reference was something that I knew would be the most important part of this, ImageField is nice, but ImageField via a Node Reference is so much better.
But I did develop a mini-module while making the demo, a dependency to the two Features I've put together (Image Library and File Bank) that allows Node Reference fields to use any non-Node Reference formatter (e.g., Use an ImageCache formatter to render a Node Reference as it's ImageField via ImageCache). Could be something of interest to you for your own work: http://drupal.org/project/formatters4nodereference

 

Have the code for the pass-by-reference fix ready to commit, still just waiting to get it tested, but with any luck shouldn't be too far away.

 

As for the token format, will start work on that as soon as you can get me the XPath filter code just to save me some time.

dman’s picture

Right.
http://drupal.org/sandbox/dman/1075470
is the sandbox for my proof-of-concept. Not ready to release on the world at all.

It includes embedder_filter() which runs embedder_dom_process() which is where my xpath happens, with the assistance of a few helper funcs.
Yeah, it uses 40 lines to to what regexp can probably do in 6 lines.
Partly that's because it's stepped out for my own debugging, partly because DOM can be quite cumbersome.
Yeah performance is sure to be several times slower that string replacements.
Yeah it's PHP5 only.

But it's a direction I'm exploring, and haven't found a reason to stop yet.

I really don't want to derail you with my ideas, so I think you'd be justified in holding off on the token format changes in the main trunk. Though .. isn't git supposed to support us trying out significant branches now? I have things to learn about that..

but ImageField via a Node Reference is so much better.

We are on a wavelength then!! Images as nodes forever.

dman’s picture

PS, if you haven't already, check out http://drupal.org/project/nrembrowser - it does some groovy ideas with nodereference and linking to directly media within the referenced items

Deciphered’s picture

Status: Active » Fixed

Haven't seen that yet, but it does look similar, except more specific functionality, to what I'm doing with this module, might have to approach them.

 

As for the pass-by-reference issue, I have committed a fix, Dev build should be out soon, else you can just check it out from GIT.

 

I did start having a play with changing the token format last night, and it might just come in incremental changes. It definitely needs something to make it more extensible, maybe just [wysiwyg_fields filed="" etc=""] for the moment, until I can spend the extra time getting something more compliant working 100%.

 

Look forward to more test results.

Cheers,
Deciphered.

Deciphered’s picture

Title: Make file for a demo- excellent idea! Preliminary issues from first testing... » Pass by reference issue
Version: 6.x-1.0-alpha1 » 6.x-1.x-dev
Component: User interface » Code
Category: support » bug
Priority: Minor » Normal
Status: Fixed » Active

Posted by Brokendesign in another issue:

I got the following errors:

    * warning: Parameter 2 to filter_wysiwyg_fields_form_alter_alter() expected to be a reference, value given in /var/aegir/drupal-6/includes/common.inc on line 2892.
    * warning: Parameter 2 to content_wysiwyg_fields_form_alter_alter() expected to be a reference, value given in /var/aegir/drupal-6/includes/common.inc on line 2892.
    * warning: Parameter 2 to wysiwyg_fields_wysiwyg_fields_form_alter_alter() expected to be a reference, value given in /var/aegir/drupal-6/includes/common.inc on line 2892.
    * warning: Parameter 2 to filter_wysiwyg_fields_form_alter_alter() expected to be a reference, value given in /var/aegir/drupal-6/includes/common.inc on line 2892.
    * warning: Parameter 2 to content_wysiwyg_fields_form_alter_alter() expected to be a reference, value given in /var/aegir/drupal-6/includes/common.inc on line 2892.
    * warning: Parameter 2 to wysiwyg_fields_wysiwyg_fields_form_alter_alter() expected to be a reference, value given in /var/aegir/drupal-6/includes/common.inc on line 2892.

Unfortunately, as I partially expected, the fix for the deprecated pass-by-reference issue broke the module for other users.

@Brokendesign, what version of PHP are you running?

Deciphered’s picture

Status: Active » Needs review
FileSize
7.56 KB

Can you guys try out the following patch and let me know if it's all working?

griz’s picture

5.3.2-1ubuntu4.7 to be precise. Patch against dev fails for me. I'm probably just getting something wrong, but its bed time here in UTC. Interesting thread of conversation - I've wondered about some of these things - markup or tokens in the content etc. And >yes< JqueryUI should use the libraries folder.

Deciphered’s picture

Try this link: https://github.com/Decipher/wysiwyg_fields/zipball/1074408

I haven't tested in 5.3 at all yet, will do so now to check it myself.

Deciphered’s picture

Status: Needs review » Fixed

Tested in 5.3.2, worked perfectly, confirmed issue prior to fix.

Committed.

griz’s picture

No more errors for me :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.