After updating to rc1, block inject doesn't respect paragraph conditions anymore or doesn't respect them properly.

E. g. if I enter "The destination needs to have more than 4 paragraphs" it will add block inject region if I have 4 or even 3 paragraphs.

It used to work in previous version, so I'm not sure what's causing the problem.

Comments

upchuk’s picture

Assigned: Unassigned » upchuk

Hey there,

Thanks for reporting. I will take a look and see what happens!

  • Upchuk committed dd692dc on 7.x-1.x
    Issue #2498375 - Some fixes to the logic that finds the half of a given...
upchuk’s picture

Assigned: upchuk » Unassigned
Status: Active » Fixed

Hey there,

I fixed the issue by addressing some problems in the logic of determining the paragraph count in the body. I'm not sure how your exact example was even working before :)

If you get a chance you can try out the dev snapshot to confirm this works.

Thanks for reporting.

1mundus’s picture

Well, it was a bit random, it usually worked, but on some pages it didn't. After updating to rc1 it stopped working completely.

I'll test it soon and let you know if it works.

1mundus’s picture

It seems to work properly now. However, the logic used is "exactly or more than", so you might want to change the wording. E. g. if you enter "more than" 5, it will inject the region if there are 5 paragraphs, although it should inject it only if it's 6 or more of them.

upchuk’s picture

Hey,

The logic is not "exactly or more than" but as it says: either "exactly", "more than" or "less than". You can check it out here:

http://cgit.drupalcode.org/block_inject/tree/block_inject.module?id=dd69...

1mundus’s picture

So if you enter 5 and select "more than", it shouldn't display the injected region if there are 5 paragraphs in the node? I don't get this behavior, it will display the region even if there are 5 paragraphs.

upchuk’s picture

Hey,

Yes, that was the bug you reported. That if you entered 5 paragraphs and selected "more than", the action was triggered if the node had 5 paragraphs. Now it should be fixed in the dev branch and only be triggered if there are more than 5. But do keep in mind #2498377: Block inject loading empty content type list: the condition is not for the region to be injected but for the offset action you specify below to take effect.

Cheers!

Status: Fixed » Closed (fixed)

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