31 replies [Last post]
Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Was this information Helpful?

Between Ubercart 1.0 and 2.0 we dumped as many dependencies as we could, because they were typically difficult for the end-user to understand. This was especially true for people who were new to Drupal. However, as has been discussed in our battle plans thread, we'd looking at adding a CCK dependency for the next version. Now I'm wondering, and would appreciate feedback, about whether or not to consider a Views dependency as well.

The reason is this... right now, we have various tables in Ubercart that it is possible to customize using something called TAPIr (the tables API). It has its limitations, but it's particularly used for product listings and the add to cart form. Now, with advances in Views since the time we started development of Ubercart 2.0, we can most likely use Views for these things instead.

Furthermore, more development has been going on in the Ubercart Views integration module, proving that it is possible to even do something like replace the main order admin page with a View (given a little bit more integration). I'm wondering if we shouldn't begin to explore a replacement of various product, cart product, order product, customer, and order lists with default Views and turn something like the catalog module into more a set of Views instead of various overrides and theme functions. I don't think Views would be an end all solution, but it may be possible to deprecate TAPIr by just making Views a dependency.

Granted, the implementation will require some very sensible defaults. Everything should still work the same, but if someone needs to tweak the way a table is displayed, they'd just as soon learn how to use Views (which will benefit them all over the place) as learn how to develop with TAPIr.

A possible drawback is the way we're using TAPIr to render forms. However, in this case, I think we might be able to just as easily leave those forms as normal forms with theme functions and allow people to alter them with hook_form_alter() if need be. I just don't believe we've really ran into too many use cases where the obvious solution is to have a more robust TAPIr.

My thoughts on having another core dependency are that if we're going to make Ubercart 3.x dependent on CCK, why not go for Views, too? It's just as popular a module, and while it can be stinkin' hard to learn how to use, with sensible defaults the newcomer will have to do nothing more than enable the Views module. Used correctly, they shouldn't even need the Views UI until they get to a point where they decide they need to tweak a display.

So... I'd like to hear your thoughts and possible pitfalls / benefits that I may have overlooked.

himerus's picture
Offline
Joined: 09/20/2008
Juice: 17
Both CCK & Views should be required

In my minimal experience with Ubercart, I'd have to say that both CCK & Views should be required.

For the Drupal noob, they could hopefully be required and just sit on the backend untouched in order to provide Ubercart with some much welcomed extra flexibility, and for the Drupal expert... well... we already have CCK and Views installed on anything more than a simple brochure site, so it shouldn't matter to those of us that fall into that category.

If it helps add to the usability and functionality of Ubercart... why not require those already VERY "core-ish" modules?!

Jake Strawn
http://himerus.com

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Both CCK & Views should be required

Good points, Jake. Also, I meant to mention in my first post that we've always required a dependency on Token, which is another one of those ubiquitous modules.

JohnnyKickball's picture
Offline
Joined: 04/29/2009
Juice: 6
No problem with the dependency, and the flexibility is welcomed

I am with the previous comment. Everyone has views installed already, and the added flexibility would be great.

joshmccormack's picture
Offline
Joined: 05/30/2009
Juice: 2
in favor

These are such major modules some question why they aren't included with core. And if these arguably standard modules can be used rather than reproducing what they do or going a more obscure route, all the better.

Josh McCormack
InteractiveQA
Drupal, Information Architecture and Quality Assurance
http://www.interactiveqa.com

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: Adding dependencies in UC 3.x

Agree with everything said above. Any new Drupal site I've started, CCK, Views and Token are the first ones I install (along with Pathauto and a couple others). I wouldn't be affected by making these requirements; in fact I'm sure their added functionality would extend their future-proofing and the new features would be a huge step forward.

I don't really see any pitfalls, so long as the default Views etc. include logical defaults Smiling

--
Help directly fund development: Donate via PayPal!

Docc's picture
Offline
Getting busy with the Ubercode.
Joined: 07/03/2008
Juice: 168
Re: Re: Adding dependencies in UC 3.x

Same here. CCK, Views and Token are a few of the modules i consider must-haves for my sites. So i really support the idea for Views dep.
I dont think you can go wrong with Views as it probaply gonna make its way into the Drupal core in the future.

stephthegeek's picture
Offline
Theminator
Joined: 10/20/2007
Juice: 575
Re: Adding dependencies in UC 3.x

Yep, big thumbs up to everything here!

Also, when learning to theme things like the catalog pages, at least there's already a lot of help out there for theming views, plus you can change a lot through the UI. Universally, whenever I see someone *experienced* with Drupal trying out Ubercart for the first time, there's this "you're serious? this isn't based on views?!?!" shock Sticking out tongue

Gorgeous original Drupal themes (and Ubercart themes!) ~ Psst: more Ubercart themes on our new site

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
stephthegeek@drupal.org
stephthegeek@drupal.org wrote:

"you're serious? this isn't based on views?!?!" shock Sticking out tongue

lol Good feedback. Someone on Twitter raised the point that led us to strip out dependencies in the move from 2.x to 3.x, namely being dependent on an external developer's timetable. Does anyone have thoughts on that? I don't anticipate any problems in the near future with Views, because as Earl expressed in his roadmap yesterday (or the day before?) Views 3 isn't going to be near as disruptive as Views 2 was. Rather, it's supposed to be more about adding and refining features than it is about rewriting the core.

This topic does still concern me, because I'd hate for us to depend on a Views 3 that didn't show up for months after Drupal 7 is released. However, who's the biggest white elephant in the room as far as being on top of updates? Oh yeah, that's us. Views 2 has been out for quite some time now, and I've yet to see a final 2.0 for Ubercart. Sticking out tongue

snicers's picture
Offline
Uber DonorInternationalizationizer
Joined: 09/20/2007
Juice: 192
Re: stephthegeek@drupal.org

Why not adding as much views integration as possiblie without depending on it? Views is a great asset in building the shop without using the catalog. But making Ubercart dependant on it makes no sense for me. You took the effort to bring up Conditional Actions instead of using Rules, and now you want to bring Views2 in?

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Re: stephthegeek@drupal.org

Yeah, I considered that angle as well. Perhaps we can just define static tables that can be overridden by Views if the appropriate Views are enabled. Take away the possibility of reordering / renaming columns and such altogether and require Views to do anything extra to modify them.

Regarding Conditional Actions, I suppose the difference there is there wasn't a working solution when we started porting Ubercart, so we were forced to roll our own (just as Views didn't support anything besides nodes in D5, so we were forced to develop the Tables API). After Rules did appear, we already had a mostly working replacement. That whole decision should definitely be revisited in the future, but I'm inclined to leave it as is for UC 3.x and focus on improving other essential core parts of Ubercart in an effort to limit to some extent the amount of time we allow for the next version.

Now w/ UC 3.0, however, we will have a working Views 2 to base our work on, but deficiencies in our Tables API mean it might take just as much time to make those more robust as it would to remove it (as much as I love it and enjoyed working on it) and revert to either a straight Views replacement or the progressive enhancement approach recommended by snicers.

Any more thoughts?

digitalfrontiersmedia's picture
Offline
Getting busy with the Ubercode.
Joined: 11/08/2008
Juice: 282
Re: Re: Re: stephthegeek@drupal.org

+1 on Views. It seems like almost everyone at some point has had to produce a customized list of products or such in one form or another and Views is the de facto way to handle that. And maybe the way to go IS to simply make it more Views compatible and make Views more of a highly suggested companion than a requirement. And given the fact that everyone here has talked about Views, this MUST be resounding with the folks.

However, nobody here has really made a comment about the CCK idea you bring up. And I find myself wondering how exactly you see it fitting in to the point of making it a requirement. I might be missing something in this, but I find it interesting nobody else really mentioned their views on it one way or the other besides the point that many people already install Views CCK as a part of their Drupal modus operandi.

[EDIT]
Sorry, I just realized I'm probably missing some of your CCK ideas in the Battle Plans post. Will read there and post back here if I have any comments that arise from reading further.

tcindie@drupal.org's picture
Offline
Getting busy with the Ubercode.
Joined: 05/15/2008
Juice: 440
Ryan wrote:Yeah, I
Ryan wrote:

Yeah, I considered that angle as well. Perhaps we can just define static tables that can be overridden by Views if the appropriate Views are enabled. Take away the possibility of reordering / renaming columns and such altogether and require Views to do anything extra to modify them.

This sounds like it might be the most elegant solution. If a user just wants a bare-bones quick & easy to set up store, it would be good if all they need to install is the core ubercart package.

However, I do think that nearly every piece of data should reveal itself to views, so that simple or complex views can be created for any piece of the puzzle: product lists, individual product pages, cart listing, reports, etc. At the same time though, I don't think we need to add a dependency on views.

I think of it kind of like imagecache. Right now ubercart works just fine if you haven't installed imagecache. If you do install imagecache, then it creates the requisite db fields and image presets to integrate imagecache with products et al. Something similar might be a good approach for views. Make ubercart work with views -- in a much more useful way than it does now -- but don't require it to be installed for ubercart to work.

Follow me on twitter.

amitaibu@drupal.org's picture
Offline
Bug Finder
Joined: 09/08/2007
Juice: 239
Re: Re: stephthegeek@drupal.org

Having a dependency in a module such as Views and CCK makes sense since it opens Ubercart to more members and developers. I already know how to handle Drupal core API, CCK and Views - now learning Tapir (just for the example) is a "waste of time".

I'm advocating the removal of as much code possible from the Ubercart maintainers (like going back to Rules instead of CA, or altering the uc_role, etc') , so they concentrate in making Ubercart core even better. Smiling

I think that the above issues show how delegating tasks can help Ubercart become better - the maintainers don't need to deal with this code yet, but can just later on review it and decide how to proceed with it.

digitalfrontiersmedia's picture
Offline
Getting busy with the Ubercode.
Joined: 11/08/2008
Juice: 282
Re: Adding dependencies in UC 3.x

Well, I read over the UC3 Battleplans--not much info there regarding your ideas behind CCK dependency but you must have good reasons even if you don't share them. Smiling

But a thought did occur if you do make Views a dependency as well, is it an odd thing to inquire about making orders nodes, too? I'm just thinking that with that being the case, it will greatly increase the flexibility of the "Reports" section.

psynaptic's picture
Offline
Early adopter... addicted to alphas.Not KulvikTheminator
Joined: 08/28/2007
Juice: 731
Views dependancy++

I believe that making the CCK and Views modules dependancies of Ubercart would be of such huge benefit. Imagine being able to edit any lists in UC using Views.

These modules are so prevalent now that I don't think we should even provide a "fallback". This would cut down the time needed to maintain the project and free up time to work on other aspects.

I'm surprised more of UC isn't already dependant on Views but at the same time I can see why it isn't. Moving everything we can over to CCK, Views, Rules etc. would IMO be the proper long term solution. I think Views will make it into core, possibly in version 8.x.

Views can work on pretty much any table and for orders we could just create a new view type:

A view has a 'base table' (we're calling this the view type, now). This is the table you're doing queries on, essentially. It can be things like node, user, taxonomy, comment, etc. It is set during creation and cannot be changed thereafter.

cha0s's picture
Offline
Getting busy with the Ubercode.
Joined: 08/22/2008
Juice: 416
Agree totally

I've been behind the scenes nagging about views and CCK dependency for a while. Eye-wink

One major area where counting on views being installed would be reports. The whole system needs an overhaul (I proposed it with a POC ages ago, but it'll be more likely to get in 3.x) and if we could outsource a lot of the work to views, then the code will be much smaller and elegant than otherwise.

IMO, the point here is that if we don't have these dependencies, it's going to manifest itself in code duplication of the given feature sets.

A list of useful dependencies to consider are: AHAH Helper, Location and Address (There is nothing currently in Ubercart that could be considered an address API for dealing with customer/order/others(?). Address module will give us that API, and Location allows us to possibly get Geocoding for free, not to mention things like postal code verification.)

I think it might be a good idea to separate all the image functionality for product/catalog/cart/etc into its own module like ubercart_image and perhaps introduce a dependency there on the modules needed like imagecache and the field modules... maybe even thick/light box for starters?

Try FreeBASIC!
My game Lynn's Legacy

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Agree totally

Regarding your additional suggestions, I don't really see why we'd need Location, but AHAH Helper and Addresses are likely candidates. Will consider that some more...

psynaptic's picture
Offline
Early adopter... addicted to alphas.Not KulvikTheminator
Joined: 08/28/2007
Juice: 731
Re: Re: Agree totally

Location is not stable enough anyway Sad

Merlin has recently hinted towards using cTools AJAX features for Views, possibly making it a dependancy, so maybe we can look at this, too.

digitalfrontiersmedia's picture
Offline
Getting busy with the Ubercode.
Joined: 11/08/2008
Juice: 282
Re: Re: Agree totally

Speaking as an Ubercoder newbie, I would caution against adding too many dependencies (especially those that have dependencies themselves). I agree with Cha0s that it sweetens the Ubercore but it might create larger barriers to adoption. What was the philosophy in taking out so many dependencies in UC2? A few main modules makes sense to me; Breaking it up to be dependent upon more than 2 or 3, though, begins to give me pause.

stephthegeek's picture
Offline
Theminator
Joined: 10/20/2007
Juice: 575
Re: Re: Re: Agree totally

Ubercart is in a bit of a unique position, needing to cater to both Drupal developer pros and very new users to e-commerce and Drupal. I think Views/CCK is a no-brainer for developers. I also think it's a no-brainer for new users, to get them using these modules that are the backbone of nearly any advanced functionality in Drupal. However, that's from the expert perspective Eye-wink

One thing I wanted to add is that moving towards the UberDrupal install profile will really help to soften the blow. It won't be a list of "oh and you need to get these ten other modules" if the installation profile really becomes what it could be.

Gorgeous original Drupal themes (and Ubercart themes!) ~ Psst: more Ubercart themes on our new site

joachim's picture
Offline
Joined: 12/02/2008
Juice: 49
+1 Views is almost a

+1

Views is almost a necessity on any site that's beyond the bare basics, so it's not like we'd be asking users to go to much trouble.
And what they'd gain in terms of flexibility is enormous.

Is there an issue open yet for getting more views support in?

psynaptic's picture
Offline
Early adopter... addicted to alphas.Not KulvikTheminator
Joined: 08/28/2007
Juice: 731
DrupalCampUK

I believe joachim is asking because we're considering a bit of a code sprint to get Views support into UC3 at DrupalCampUK which is this weekend. No promises but we feel it's such an important thing to get in that we may be able to at least get the ball rolling.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: DrupalCampUK

Gotcha - I'd love to have more robust Views support in core, but at least for 2.x this is happening in contrib space at http://drupal.org/project/uc_views. From what I understand, a lot has been accomplished. I'd start there and see where you can pitch in! Smiling

psynaptic's picture
Offline
Early adopter... addicted to alphas.Not KulvikTheminator
Joined: 08/28/2007
Juice: 731
Re: Re: DrupalCampUK

Thanks for the tip. We were already thinking uc_views would be a great starting point.

PepeMty's picture
Offline
InternationalizationizerNot Kulvik
Joined: 11/26/2007
Juice: 158
+1 on Views and CCK In a

+1 on Views and CCK

In a store I already built I make an extensive use of Views + fastsearch 'cause the inventory has 3600+ products (fortunately no pics requiered by the client since the very academic nature of the products: biomedical lab reactives), so I made a view by manufacturer, another one by SKU and yet another one which is the whole enchilada.

I always say that Views and CCK are my friends Smiling

Warm regards from sunny México!
Pepe

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: +1 on Views and CCK In a

Also, I was tipped off to the View Table Wizard. It appears to be a module that facilitates exposing custom database tables to Views 2. Maybe that can help the process?

http://drupal.org/project/tw

psynaptic's picture
Offline
Early adopter... addicted to alphas.Not KulvikTheminator
Joined: 08/28/2007
Juice: 731
Re: Re: +1 on Views and CCK In a

Good tip. I saw something about this module in the context of importing stuff into Drupal. I'll make sure we look at this when considering our plan of attack. Thanks!

joachim's picture
Offline
Joined: 12/02/2008
Juice: 49
Re: Re: Re: +1 on Views and CCK In a

Ryan, any chance you or another of the core UC developers could give us a hand here? http://drupal.org/node/488490

redben's picture
Offline
Joined: 03/02/2009
Juice: 19
To Depend or Not to Depend, that is the question

I have been playing with ubercart for sometime now, and here are my suggestions :
Ubercart is a big project, with a set of modules. When you want to build an ecommerce site using drupal / ubercart. The central features are within ubercart. Drupal is "just" the infrastructure.
So why not take a different approch and release ubercart as an install profile or a drupal distro. Others have done it, prosepoint, hostmaster (aegir), openatrium.
That way dependencies would be easier to manage for end user.

As for the package content, i see the following as good candidates to include (though many of you won't agree Smiling )

  • CCK : Though there are thoughts to decouple products from nodes (by CpILL on the forums), UC coold have a cck_product to reference a product in its product_description node type, or even, if you turn orders as nodes and add a cck_order_item field implicitly leveraging views integration for orders Smiling
  • Views : Absolutely. No comment.
  • Tokens : Who doesn't ? i'm wondering why it didn't make it to core in D7...
  • Date api/Date locale : supports localisation. Can let UC delegate all functions dealing with date (less code to maintain). Well supported and integrates with CCK Views and Tokens.
  • Rules : Dependecy on ex-workflow-ng was removed. If rules was ready at the time UC 2.x was released may be things would have been different. Rules has gone a long way since workflow-ng, especially forms integration.
  • Oh and if you go with a distro or install profile, of course this would include THE UberTheme!
    Edit: I wish to "hyper-subjectively" add Location as a replacement to address handling in UC Smiling

To Depend or not to depend
I don't think there is "any real" problem with depending on third party modules, as long as these meet some key selection points, ie:

  • Well supported.
  • Preferrably interdependent, as it makes one pull another to the top (think views->cck, token->views)
  • Maintainers' "devotion"
  • You name it...

Of course this just my point of you, not a drupal/ubercart guru developer. Just an end-user. For the time being Smiling

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: To Depend or Not to Depend, that is the question

Thanks for your thoughts! I'm happy to say that they line up quite nicely with our thoughts on the future direction of Ubercart. Check out my recent blog post on the 2.0 release and are path forward for more info. Smiling

giorgio79@drupal.org's picture
Offline
Joined: 02/02/2008
Juice: 280
Re: Adding dependencies in UC 3.x

UC Catalog could be replaced with a simple Taxonomy vocabulary as well Smiling

I already did it, it was two clicks, that consisted of creating a Catalog Free Tagging Vocabulary Sticking out tongue

Unlike Views, and CCK, Taxonomy is a core module, with massive modules support...This would be a safe external dependency, freeing up even more time and energy to the Ubercart boyz for the core that should be Ubercart, the Buying process Sticking out tongue

Adding this to the 3.x battle plans as well Smiling