Thread: Text being cut
Created on: 03/08/09 04:49 PM
| New topic Reply | Page: 1 |
| Replies: 10 | |
| mplacona
|
03/08/09 4:49 PM Hi, I really think this is a dumb question, but anyway, I couldn't find any answer to it, so here it goes. Since I installed mango, I noticed that my posts are being "cut" after a few (roughly 5000) characters are displayed. I don't know what might be happening, but I tested my DSN to see if it wasn't the CF messing up with the large chunk of data, and also checked the database to see if all the data was really there. There's nothing wrong with CF configs or the data, but it simply cuts once it's displayed by mango. I don't know if mango has any limitations on the number of characters, but if it does, can anybody here please tell me where to change it? Here's an example of my problem: http://www.placona.local/blog/post.cfm/learning-jquery-book-review If you scroll till the end of this post, you'll see that it was cut at the end, and basically, the post doesn't have an end. :-) Any help would me much appreciated. Cheers |
| Link | Top | Bottom | |
| mplacona
|
03/08/09 5:15 PM Just thought I should give some more information here here and fix the URL, as I ended up giving my local URL here. the correct URL is: http://www.placona.co.uk/blog/post.cfm/learning-jquery-book-review And my blog runs on mySQL. I can read the whole post if I go into edit mode, but can't see all the contents on the blog's homepage, that's why I think it's something to do with the homepage. I tried changing skins, just to make sure it wasn't it. but still no joy. Cheers |
| Link | Top | Bottom | |
| mplacona
|
03/09/09 1:57 AM Anyone? This is really bugging me now, and I can't seem to find what's wrong with it. |
| Link | Top | Bottom | |
| Laura
Wizard |
03/10/09 12:30 PM Hi, I thought it could be a driver issue, but since you are able to see the whole post in edit mode, it must be something else. I am traveling right now, but I'll check to see if I can reproduce the problem and figure what the problem might be. |
| Link | Top | Bottom | |
| Laura
Wizard |
03/10/09 12:49 PM Hi Marcos, Are you sure you see the whole post in the admin? I tried it and while it didn't give me any error, it chopped the text in the admin as well. The problem was a setting in the administrator for that specific datasource. You need to click Show Advanced Settings in your datasource form, and check the setting: "-- Enable long text retrieval (CLOB)." |
| Link | Top | Bottom | |
| mplacona
|
03/10/09 3:39 PM Hi Laura, thanks for your answer, I'm pretty sure I can see the whole contents in the admin, but not on the front page. I even showed it to a colleague today, just to prove I wasn't crazy :-) I think I've just found what the problem is, or at least, now I have an an idea of what's happening. On the file: /blog/components/entryWrapper.cfc, if you go to function: getContent You will see: <cffunction name="getContent" access="public" returntype="string" output="false"> <cfset var event = ""/> <cfset var eventData = structnew() /> <cfset eventData.originalObject = variables.myObject /> <cfset eventData.accessObject = variables.myObjectClone /> <cfset variables.myObjectClone.content = variables.myObject.content /> <cfset event = variables.pluginQueue.createEvent(variables.eventNames["getContent"],eventData,"ObjectAccess") /> <cfset event = variables.pluginQueue.broadcastEvent(event) /> <cfreturn event.accessObject.content /> </cffunction> Basically, when it returns <cfreturn event.accessObject.content /> that's when it chops off part of the content. I changed this file to return the contents from originalObject instead of accessObject, so now, the return is: <cfreturn eventData.originalObject.content /> I tested it, and everything seems fine now. I haven't really assessed what all the impacts will be (I believe everything exists for a reason :-P ), but I've run a few tests, and everything seems ok. As this only returns contents, I don't think returning content from another structure will impact anything, but who better tha you to know that right :-) Well, that was it really, can you please let me know what your thoughts are about it? Thanks in advance |
| Link | Top | Bottom | |
| Laura
Wizard |
03/10/09 11:08 PM Hi Marcos, By sending the contents of the originalObject, you are by-passing all the changes made by any plugin that makes changes to the post content before it gets shown. Since that is how you got it working, then the culprit must be a plugin. Which plugins do you have enabled? |
| Link | Top | Bottom | |
| mplacona
|
03/11/09 3:19 AM Yes Laura, that's exactly it. I was using Code Coloring by Russel Brown as it seemed more appealing than mango's native plugin. For some reason it can't handle a lot of characters. I didn't really investigate what's wrong with the plugin, but I'll try to contact Russel and see if we can fix this bug. If you wanna try it yourself, simply enable Russels plugin and disable yours. Make a big post, and include some <code> tags, and that should do it. I tested with many posts, and that's exactly what happens. It took me a long time last night to isolate the problem, but at the end it was easier than I though. It simply fade away by disabling Russels plugin and enabling yours. I'll follow you up as soon as I have news. With kindest regards, Marcos Placona |
| Link | Top | Bottom | |
| Russell2566
|
03/11/09 5:35 AM I'll look into this to see if I can reproduce and fix. I'm not doing anything that I would consider fancy... I don't know if there is a limit to reg-ex that I'm unaware of? Otherwise I could have a math issue that pops up somewhere with extremely long posts. |
| Link | Top | Bottom | |
| mplacona
|
03/11/09 6:05 AM Let me know if you need any help Russel. Thanks |
| Link | Top | Bottom | |
| Russell2566
|
03/11/09 7:34 AM Thanks Guys I did have a bug and it has now been, more info can be found here: http://www.empiregpservices.com/blog/post.cfm/mango-blog-plugin-code-coloring-bug-fix |
| Link | Top | Bottom | |
New Post