I was happy to come across this module. I was working on hard coding contextual links and this answered my need. On the second site I used it on I assumed it would work too but it didn't. I was using views context panes in page manager. Views can come in all different forms (although I often use blocks) so I spent a little bit of time and created a patch to add views functionality.

Comments

circuscowboy’s picture

Status: Active » Needs review
StatusFileSize
new9.94 KB

Here is the patch off the latest dev.

Just before I uploaded I realized that if someone didn't have views installed it might break. I don't know why someone wouldn't have views installed but I will look into creating a couple of conditions and up another patch soon.

bkoether’s picture

Hi circuscowboy,

thanks for providing this patch. I will give it a test spin tomorrow.

bkoether’s picture

Actually... thinking of this, it makes me wonder if it would be better to have your patch created as a submodule that has Views as a dependency.
I know that there are not a lot of sites that will not use views... but in order to avoid implementing a large number of double checks if the module exists, this might be a cleaner implementation.

I will put some more thought into this tomorrow.

circuscowboy’s picture

I was thinking of that. It would probably mean some changes in the module to make it more of an api and then it would be easier to add support to views - panels - and what ever else uses contextual links. Even blocks could be separated as some people might disable blocks.

I was thinking that the table could be re factored to combine ct nid block and now view into a generic column that could be used for all link types. That way when things expand more the table doesn't go out of control.

bkoether’s picture

Definitely have to give this some thought... I guess I assumed the block module would always be there but you are right, this is a missing dependency that could lead to issues.

circuscowboy’s picture

I am hoping to spend a little time on this weekend - If you have done any thinking or doing, let me know. I don't want to repeat the effort.

bkoether’s picture

Status: Needs review » Active

I decided to separate out the block functionality into a submodule and hope to have this up by then end of Friday. This should give a good template on how other submodules need to be structured in order to add functionality. I also revisited the DB table as you suggested and made it more generic.

Now the question is if you would like to create your own submodule based on these changes or if you want me to incorporate your patches into the CCL package as a submodule. I'm cool either way.

Really appreciate your work on this and your interest in helping making CCL a really useful module.

circuscowboy’s picture

I have been itching to get some time to make patches and help out. I will gladly rework the ccl_views module. Now that I spent the time to understand all of you code it will go smoothly. I learned a lot going through the code. I think that your implementation of caching is great and will save on a great deal of queries. Making the module extendable will give it a much easier expansion path.

Excited to see the new code tomorrow.

bkoether’s picture

Status: Active » Needs review

Hey circuscowboy,

I just committed the latest version and the dev snapshot should be available pretty soon.
This new release has the block features broken out into a submodule. So CCL core only supports nodes.

If you follow the example in the new ccl_blocks modules you should be able to quickly adjust the work you have done so far for the views support.

I want to hold off on releasing 7.x-1.1 until you had a chance to test the current dev snapshot and finish your work for the views support.

circuscowboy’s picture

StatusFileSize
new1017 bytes

I have just started getting things going but here is an important patch for the ccl.install.

Your updates hooks work great but if you are not upgrading the schema is the old schema.

I will include this in my final patch as well if you want to wait.

bkoether’s picture

Darn... I knew I fortgot something!
Thanks for catching that. Will apply that patch tonight.

circuscowboy’s picture

StatusFileSize
new8.64 KB

Here is the complete patch.

I don't know how or if a patch can make a new folder for the 2 new files are not in a folder.

I had to make one tweak to ccl.admin.inc to make things work.

There had to be a test to see if the link info was created or else the next module would just over write it with ""

else {
        foreach (module_implements('ccl_link_info') as $module) {
          $options = module_invoke($module, 'ccl_link_info', $record);
          if($options){
            break;
          }
        }
      }

I have tested out the basics but will test it out more tonight. Things seem to be working as they were before.

bkoether’s picture

Thanks Scott,

I will merge it all together tonight.

bkoether’s picture

I merged your changes into the dev branch. Didn't really had time to test it a lot but I only got the "All views" option to work. The other two wouldn't display any links.
My weekend is pretty much booked up but I will have some time off next week to work more on it.

circuscowboy’s picture

StatusFileSize
new1.07 KB

Yes there were errors in the write to cache

here is a patch for the ccl_views,module

It has to be used inside the ccl_views folder.

bkoether’s picture

Status: Needs review » Fixed

Now available in 7.x-1.1.

Status: Fixed » Closed (fixed)

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