joomla异常处理之--文章编辑时单元下拉框无法显示细目
2015-05-13 21:36
459 查看
最近,完成了网站的迁移,然而在测试时,发现一个异常情况:文章编辑时单元下拉框无法显示细目,百般查找,没有头绪,后来在一篇文章(详见:参考资料)的启示下,查找并解决了这个问题
joomla异常处理之--文章编辑时单元下拉框无法显示细目
关键字:joomla,类别,单元,图片,新文章,MOSImage Control,com_content,drop-downs
最近,完成了网站的迁移,然而在测试时,发现一个异常情况:文章编辑时单元下拉框无法显示细目,百般查找,没有头绪,后来在一篇文章(详见:参考资料)的启示下,查找并解决了这个问题
问题现象:在写新文章时,有两个异常情况:
1:选中Section(单元)后,相应的Category(类别)下拉框只有一个“请选择类别”提示,没有明细的类别条目;
2:在文章图片(MOSImage Control )处,仅有根目录的图片,子目录图片均没有出现。
产生原因:因为com_content组件在处理文章编辑时,需要使用javascript装载数据库的类别、单元条目和图片路径下的所有文件列表,用于进一步编辑,如果其中的文件名存在单引号,产生解析错误。
最终导致无法正确装载设置的类别、单元条目和图片文件列表。
查找方法:在编辑界面,查看网页源码,查找包含单引号的有问题的文件名。可以在查找以前,将以下三种正确的情况替换为”---“等符号后,再查找那个可恶的单引号:三种正确的情况分别是。(', 和 ','以及,)
处理:改名或清除。
例如:以下是有问题的几个文件名:
¨?1905ūμ???,'??¨?1905ūμ??? );
a's2.jpg---Lilla's2.jpg---;
参考资料:"com_content/new" drop-downs misbehaving
http://forum.joomla.org/viewtopic.php?f=34&t=368702
Author :cgremlin
Post subject: "com_content/new" drop-downs misbehaving
Posted: Wed Feb 04, 2009 8:46 am
Hi all,
I'm just started having some difficulty with a site running on 1.0.12 - when attempting to add new content, the Section drop-down populates properly, but once a section is selected, the Category drop down doesn't populate, containing only the item "Select Category". If I edit existing content, the Category drop-down is populated properly, but does not re-populate if the Section selection is changed. Additionally, selecting the "Images" tab (MOSImage) brings its own issues - selecting a different folder no longer refreshes the list of available images. On a lark, I updated a backup of the site to 1.0.15, and am seeing exactly the same behavior there as well.
Everything was working great for the past year or so prior to a fairly large update, and while I can restore back to the state immediately prior to the update, I'd rather not have to re-enter a bunch of content if I can avoid it, plus it'd be nice to understand the nature of the failure. Given that it seemed to happen right after the content update, I'm guessing I've got something that's gotten corrupted in the database, but the PHP and MySQL logs don't indicate anything out of the ordinary. Does anyone have any ideas where I might start to look to fix this without having to slog through thousands of lines of PHP?
After a bit of debugging, I was finally able to determine what was causing this problem. Turns out, way down in the "image" hierarchy, there was a directory that contained a single quote in its name. This quoted directory name apparently was not parsed correctly and resulted in the generation of a faulty Javascript source line when creating/filling the folderimages[] array in admin.content.html.php (line 507), which ultimately resulted in a Javascript error being quietly generated. The generated Javascript line was setting almost 18,000 elements in the folderimages[] array, and the error in this particular case didn't actually occur until around the 13,000th element, and the generated source line was almost 2.5 megabytes long. It wasn't until I changed admin.content.html.php to put each element assignment on a separate line (instead of the tabbed separation it normally uses) that I was able to determine exactly what the browser was complaining about.
Through a Rube-Goldberg-like set of dependencies in the generated Javascript, this failure ultimately resulted in writeDynaList() being passed a bad source array, and it was this extremely indirect failure in writeDynaList() that was responsible for the problems I originally reported, as the bad source array prevented any drop-downs from being populated.
So, after all that, the fix ended up being just renaming the directory containing the single-quote in the name. If anyone else ever experiences this problem, check those directory names first thing to make sure they don't have any wacky characters.
joomla异常处理之--文章编辑时单元下拉框无法显示细目
关键字:joomla,类别,单元,图片,新文章,MOSImage Control,com_content,drop-downs
最近,完成了网站的迁移,然而在测试时,发现一个异常情况:文章编辑时单元下拉框无法显示细目,百般查找,没有头绪,后来在一篇文章(详见:参考资料)的启示下,查找并解决了这个问题
问题现象:在写新文章时,有两个异常情况:
1:选中Section(单元)后,相应的Category(类别)下拉框只有一个“请选择类别”提示,没有明细的类别条目;
2:在文章图片(MOSImage Control )处,仅有根目录的图片,子目录图片均没有出现。
产生原因:因为com_content组件在处理文章编辑时,需要使用javascript装载数据库的类别、单元条目和图片路径下的所有文件列表,用于进一步编辑,如果其中的文件名存在单引号,产生解析错误。
最终导致无法正确装载设置的类别、单元条目和图片文件列表。
查找方法:在编辑界面,查看网页源码,查找包含单引号的有问题的文件名。可以在查找以前,将以下三种正确的情况替换为”---“等符号后,再查找那个可恶的单引号:三种正确的情况分别是。(', 和 ','以及,)
处理:改名或清除。
例如:以下是有问题的几个文件名:
¨?1905ūμ???,'??¨?1905ūμ??? );
a's2.jpg---Lilla's2.jpg---;
参考资料:"com_content/new" drop-downs misbehaving
http://forum.joomla.org/viewtopic.php?f=34&t=368702
Author :cgremlin
Post subject: "com_content/new" drop-downs misbehaving
Posted: Wed Feb 04, 2009 8:46 am
Hi all,
I'm just started having some difficulty with a site running on 1.0.12 - when attempting to add new content, the Section drop-down populates properly, but once a section is selected, the Category drop down doesn't populate, containing only the item "Select Category". If I edit existing content, the Category drop-down is populated properly, but does not re-populate if the Section selection is changed. Additionally, selecting the "Images" tab (MOSImage) brings its own issues - selecting a different folder no longer refreshes the list of available images. On a lark, I updated a backup of the site to 1.0.15, and am seeing exactly the same behavior there as well.
Everything was working great for the past year or so prior to a fairly large update, and while I can restore back to the state immediately prior to the update, I'd rather not have to re-enter a bunch of content if I can avoid it, plus it'd be nice to understand the nature of the failure. Given that it seemed to happen right after the content update, I'm guessing I've got something that's gotten corrupted in the database, but the PHP and MySQL logs don't indicate anything out of the ordinary. Does anyone have any ideas where I might start to look to fix this without having to slog through thousands of lines of PHP?
After a bit of debugging, I was finally able to determine what was causing this problem. Turns out, way down in the "image" hierarchy, there was a directory that contained a single quote in its name. This quoted directory name apparently was not parsed correctly and resulted in the generation of a faulty Javascript source line when creating/filling the folderimages[] array in admin.content.html.php (line 507), which ultimately resulted in a Javascript error being quietly generated. The generated Javascript line was setting almost 18,000 elements in the folderimages[] array, and the error in this particular case didn't actually occur until around the 13,000th element, and the generated source line was almost 2.5 megabytes long. It wasn't until I changed admin.content.html.php to put each element assignment on a separate line (instead of the tabbed separation it normally uses) that I was able to determine exactly what the browser was complaining about.
Through a Rube-Goldberg-like set of dependencies in the generated Javascript, this failure ultimately resulted in writeDynaList() being passed a bad source array, and it was this extremely indirect failure in writeDynaList() that was responsible for the problems I originally reported, as the bad source array prevented any drop-downs from being populated.
So, after all that, the fix ended up being just renaming the directory containing the single-quote in the name. If anyone else ever experiences this problem, check those directory names first thing to make sure they don't have any wacky characters.
相关文章推荐
- 异常信息:CLR无法从COM 上下文0x645e18 转换为COM上下文0x645f88,这种状态已持续60秒。拥有目标上下文/单元的线程很有可能执行的是非泵式等待或者在不发送 Windows 消息的情况下处理一个运行时间非常长的操作.这种情况通常会影响到
- 异常信息:CLR无法从COM 上下文0x645e18 转换为COM上下文0x645f88,这种状态已持续60秒。拥有目标上下文/单元的线程很有可能执行的是非泵式等待或者在不发送 Windows 消息的情况下处理一个运行时间非常长的操作.这种情况通常会影响到
- Photoshop文字编辑显示异常的处理
- servlet使用声明式异常处理指定错误跳转页面,ie下无法正常显示
- 异常信息:CLR无法从COM 上下文0x645e18 转换为COM上下文0x645f88,这种状态已持续60秒。拥有目标上下文/单元的线程很有可能执行的是非泵式等待或者在不发送 Windows 消息的情况下处理一个运行时间非常长的操作.这种情况通常会影响到性能,甚至可能导致应用程序不响应或者使用的内存随时间不断累积
- OllyICE 调试的程序无法处理异常 解决方法
- 关于CSDN登录时,图片检验码无法显示的问题处理
- 询问用户是哪个年级的同学,对输入的数据进行保存,将结果显示在屏幕上。要求合法年级为1,2,3.自定义异常类GradeExceptio,对输入非法的情况进行异常处理。
- Spark集群工作异常,无法读取Hadoop集群文件处理办法
- PHP-问题处理验证码无法显示出来
- 无法显示XML页--名称以无效字符开头。iis处理资源时出错的解决办法
- Net 下未捕获异常的处理 (无法预料的异常处理)
- 新的csdn的blog系统居然无法编辑文章
- OpenCV问题集锦,图片显示不出来,WaitKey(0),imread()不能读图片,未经处理的异常,等问题集合
- Java 异常处理及其应用- IBM的文章质量很高
- 数据库异常关闭后无法启动问题处理一例
- WordPress博客后台不能显示所有主题和无法编辑主题的问题的解决方法
- 自行解决12306页面显示异常的问题(长城宽带下WWW。12306无法正常使用)
- DataGridView不能正常显示、编辑、排序的处理
- oracle 隐式游标,显示游标,游标循环,动态SELECT语句和动态游标,异常处理,自定义异常