Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
We have found a name space conflict with a theme. This patch changes the file name of /theme/content.css to /theme/cck-content.css.
Marking as critical for final.
Comment | File | Size | Author |
---|---|---|---|
D6_cck_namespace_conflict.patch | 5.34 KB | hass |
Comments
Comment #1
tobiasbComment #2
yched CreditAttribution: yched commentedI really don't think this is critical.
'content' is the name of cck's main module, so it is rightfully occupying it's own namespace.
I'm not sure I see how two css files with the same name but in differen folders could conflict ?
Comment #3
hass CreditAttribution: hass commented@yched: have you ever heard about theme overriding? This happens here... if a theme uses content.css file core replace cck's content.css with the theme file. The same have already been happen with IMCE. I assure you this is critical or very important.
See #273984: Prevent name space conflict on css override and this is why views renamed all CSS files into
views-*
what have IMCE already done here, too. IMCE have also used a content.cssComment #4
hass CreditAttribution: hass commentedHere is the views issue #262049: Drupal 6 needs module specific css file names....
Comment #5
hass CreditAttribution: hass commentedAnd here is the documentation how theming works http://drupal.org/node/171209
Comment #6
KarenS CreditAttribution: KarenS commentedIt seems to me that the problem is that IMCE used content module's namespace, and it looks like they have corrected it. I see no reason for the 'Content' module not to be able to use its own name in css. We don't use 'cck' anywhere, that is not the name of this module, but it is the name of dozens of other CCK contrib modules, and if we start using 'cck' that could create other name conflicts with those modules. Now that IMCE has renamed its css, the original issue should not be a problem any more.
The only remaining reason for changing the name that 'content' is already used by Drupal as a class and id name, and I can see there could be confusion there. And that might be a valid reason to make a change.
But if we make a change, we should use the right namespace, not 'cck'.
Comment #7
hass CreditAttribution: hass commentedKarenS: The YAML theme have a content.css file and this file now overrules CCK's content.css.
The main problem is that all CCK modules are using a wrong namespace. This may be a design flaw of drupal core, but as you know namespacing in CVS is based on directories. By this way *all* cck module's should normally be prefixed by the CCK-[module name]. Otherwise there could be other modules that collide with this name.
The ICME problem is not related to the CCK problem - it only shows how ICME have workaround'ed like VIEWS and other modules the theme override problem. Don't understand the above wrong - the content.css of CCK have never overriden the ICME content.css. But the YAML content.css overrides the CCK content.css. This is how D6 was designed.
What is the problem to follow the naming way John described here http://drupal.org/node/262049#comment-855209? It would solve the issue and solve the namespace conflicts. I'm also expecting that more and more problems like this showing up with the wrong naming that CCK uses. I know this is historical, but it causes big issues.
The unique namespace is only preserved by CVS in the top level folder... what is the main issue. By this way I could also write a module that is named "foo" and a submodule of "foo" that is named "content". In such a situation I have another module that is named "content" and the subfolder is not recognized by Drupal in many ways what will create many follow up issues if someone uses CCK and my foo\content module. Have someone ever thought about this problem?
Please also read all the linked issues and ask the merlin who build this system and you might get the explanation why this patch is RTBC. He should explain best. I don't know that need work on this patch. This one is RTBC.
Comment #8
hass CreditAttribution: hass commentedNormally - as I have understood the Drupal CVS the whole CCK modules would needs a rename. This would end with:
cck_content.module
cck_content_copy.module
cck_content_permissions.module
cck_fieldgroup.module
cck_nodereference.module
cck_number.module
cck_optionwidgets.module
cck_text.module
cck_userreference.module
This would be the only way to prevent namespace conflicts in general. Prefix every submodule and the main module with the top level CVS path.
Comment #9
KarenS CreditAttribution: KarenS commentedOr change the folder name to 'content', which would make more sense. I don't know why it was ever named 'cck' since 'cck' was never intended to actually be used anywhere. We now have dozens of contrib modules names 'cck_' something or other, I would more worry about namespace conflicts if we suddenly rename all our files to use the 'cck' prefix.
And it sounds to me like it's a bug for a theme to use 'content.css' as a file name. That name does not match the theme's namespace and everyone knows that CCK has been using that name for several years.
So now we're discussing renaming modules and/or paths. That's why this is 'code needs work', I don't know what we want to do with this, it needs to be discussed and decided.
Comment #10
KarenS CreditAttribution: KarenS commentedPicking up on my previous thought, we can't change the module names. I tried to do that in another place once and it won't work because there is absolutely no way to make the upgrades work right if you do that. A new module cannot pick up any information about the update state of another module, the update system just won't support it. And our update process is already complicated enough with lots of places to break.
A new module named 'content_fieldgroup' cannot retain database information from a previous but no longer there module named 'fieldgroup', and has no way to realize that enabling the new content_fieldgroup module should not run the install process as usual but should instead run the update process using update status data from the old fieldgroup module. It would be a nightmare to make this work and would take many many hours of testing and debugging, and would probably still be broken.
Changing the path could be done without breaking updates, but would create chaos if people leave the old files in the old location and try to use both new and old files together.
So I think we have to say "what's done is done", the current path and module names must remain as they are. The main way there would ever be namespace conflicts is if someone else creates a module that lives in a path called 'content', and if they do that, shame on them for asking for trouble, knowing that we already have a widely-used module called 'content'.
If we agree that file and path names will remain as they are, then I guess the original patch may be as much as we can do.
@yched, any thoughts?
Comment #11
hass CreditAttribution: hass commentedWell I know the upgrade will be difficult and only work if we rebuild the update logic. Nevertheless we should be aware that every additional submodule gives more a chance for a conflict. I haven't yet searched CVS if there are other modules or submodules named the same like any CCK submodule or any upcomming CCK module and I don't expect that many people know about this namespace problem...
Comment #12
KarenS CreditAttribution: KarenS commentedThe upgrade path is already exceedingly fragile and easily broken, we already get dozens and dozens of upgrade problem issues. Adding this kind of complication to it would practically guarantee that I would be spending the next few months fixing problems it creates, and I don't have time to do that.
Renaming 'content.module' would also break every one of the hundreds of contrib CCK modules, since they all include content.module in places in order to use the content module code in installs and elsewhere, and they would have to fix their code.
The less destructive change would be to change the path from 'cck' to 'content'. If we do that, content, content_copy, and content_permissions are properly named. Any new modules we add can be properly named, and only fieldgroup, text, number, nodereference, userreference, and optionwidgets are mis-named. Those are all going into core in D7 (probably), so I think we can defer worrying about those since they will get re-named or re-organized at that point.
Comment #13
yched CreditAttribution: yched commentedEr, we're definitely *not* changing modules names - especially not if the original issue is merely over a css file. Anyone willing to do so is welcome to take over CCK maintainership :-)
About the problem at hand, I'd rather go with content-module.css. -1 for introducing cck as a namespace.
Comment #14
KarenS CreditAttribution: KarenS commentedI'm going to commit a change to make it content-module.css and leave the namespace issues alone. Trying to fix those will introduce a host of other problems we don't need and there is no evidence it has actually created any problems for anyone.
Comment #15
hass CreditAttribution: hass commentedTHX
Comment #16
yched CreditAttribution: yched commentedI removed the old content.css file, that was still present.
Comment #17
KarenS CreditAttribution: KarenS commentedOops! I thought I had done that :)
Comment #18
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.