[Solved] Couple of issues

Post

Posted
Rating:
Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 (Liked by Joey)
#4982 (In Topic #1006)
Hey All!

Just going to plop these here for the time being in case I've missed a resolution to same somewhere. If they are indeed issues, I'll post them in the bug tracker and delete this post.

1) Side news archive shows the different years/months in which items have been posted, but clicking on any of the months returns all the posts in the database.

2) Side news category list

Code

{$STRIP_TAGS,{!CATEGORY_SUBORDINATE_2,{COUNT*}}}
shows '1 entry' for every category regardless of actual amount.

Thanx!
SD

Last edit: by SoccerDad


Post

Posted
Rating:
Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 (Liked by Joey)
#4983

Post

Posted
Rating:
#4984
Hey Chris!

Thanx for the welcome, appreciated, I've missed being able to hang out here! I apologize for disappearing on and off, however, I've now hung up my chef knives for good and it's back to geeking full time, yay! :D I'm looking forward to getting back into Composr and hopefully being able to give back to Composr after all the years of fun it's given me!

Thanx also for the fixes and the fast turnaround, *grin*, another reason why I love it here!

One further unrelated question if I may: I'm looking to refine my CSS and layout skills (OK, looking to develop them might be a better phrase ;) ). I'm not much of a creative type, however, I'm pretty good at the proverbial 'embrace and extend' so I'm going to work away at adapting some good looking open source themes for Composr and posting them here for the community. My question surrounds v11: are there going to be significant changes to the underlying themeing structure and should I wait until some betas are released or is it OK to go ahead and start now on v10.0.21 and just apply any tweaks that may be necessary to adapt to the new version?

TIA!
SD/TR

Post

Posted
Rating:
#4986
Changed the topic title just a wee bit too soon:

1) The archive block now grabs the correct year and month to start with, but after all posts are shown meeting the selected criteria, all previous posts prior to the selected criteria are also shown.

2) Adding the side categories block after making the changes (I made the changes by hand twice just to make sure it wasn't the very possible operator error ;) ) produces a stack trace. PHP notice:

Code

PHP NOTICE [8] Undefined index: _nc_title in sources/global3.php on line 1481 (version: 10.0.21, PHP version: 7.2.10-0ubuntu0.18.04.1, URL: /cms/index.php?page=cms-comcode-pages&type=__edit&keep_no_xhtml=1)
and the culprit line appears to be:

Code

File    '/var/www/shatter/sources/blocks/side_news_categories.php'
Line    97
Function    'sort_maps_by'
Args    

array

'_nc_title'
which on my end is:

Code

sort_maps_by($categories, '_nc_title');

The issue appears to be limited strictly to the sorting action as the counts are now correct but the categories are no longer sorted.

Troubleshooting steps:
  1. caches cleared each test run
  2. commenting out line 97 clears the error, counts are still correct, no sorting occuring
  3. comparing phpmyadmin cms_news_categories with output shows output in the same order as the database table when it is unsorted
Note: I have one category that has no articles in it and despite the routine from line 88 to 95, it is not shown in the output.

Post

Posted
Rating:
#4987
Re latest post (not read prior post yet)…

1- This is expected. It just jumps into the pagination at a certain point. I'll add a tracker issue to consider changing that.

2- Try this https://github.com/ocproducts/composr/commit/fccfe3469add9974e0b65403e52852b6ab5be6a9
Oddly I couldn't reproduce an error, although I clearly see the bug. Seems to be a difference between PHP versions.

Post

Posted
Rating:
#4989

Chris Graham said

Oddly I couldn't reproduce an error, although I clearly see the bug. Seems to be a difference between PHP versions.

Ah, because I had only one category to show, no sort work needed doing.
Added a check on dev-mode to make it catch these errors (no need for these changes, just posting for reference/interest):
https://github.com/ocproducts/composr/commit/d4be28a464dc616c60822ecba9d82e00198a2663

Post

Posted
Rating:
#4990

SoccerDad said

Hey Chris!

Thanx for the welcome, appreciated, I've missed being able to hang out here! I apologize for disappearing on and off, however, I've now hung up my chef knives for good and it's back to geeking full time, yay! :D I'm looking forward to getting back into Composr and hopefully being able to give back to Composr after all the years of fun it's given me!

Thanx also for the fixes and the fast turnaround, *grin*, another reason why I love it here!

One further unrelated question if I may: I'm looking to refine my CSS and layout skills (OK, looking to develop them might be a better phrase ;) ). I'm not much of a creative type, however, I'm pretty good at the proverbial 'embrace and extend' so I'm going to work away at adapting some good looking open source themes for Composr and posting them here for the community. My question surrounds v11: are there going to be significant changes to the underlying themeing structure and should I wait until some betas are released or is it OK to go ahead and start now on v10.0.21 and just apply any tweaks that may be necessary to adapt to the new version?

TIA!
SD/TR

Well, you're very welcome back - and no need to apologise, it's not a jail ;-).

v11 themeing will change a great deal, so themes will not be easy to adapt. Salman has been putting in a considerable amount of work modernising everything.
I can't say when a v11 beta will be out – it's in Salman's hands right now, and I'm still getting my life fully back in order after moving out here to the US (this week it's dental stuff eating up all my time). Things are a lot more settled for me than they were, but at the same time I have to get a good volume of billable hours out. I think in the new year I will have a big spike in free time to get things towards the finish line.

Post

Posted
Rating:
#4991
Oh btw, in the future please try to separate things out into more topics. Recently we had a guidelines change, and to keep things tidy, and less monolithic, I'd like topics to be more directed. Makes it easier to manage, follow, and easier for others to chime in. I didn't care in the past as frankly my thinking has changed on it.

Post

Posted
Rating:
#4994

News archive block: gotcha on that. My $0.02 on any changes in that behaviour: the only navigability/usability concern I can think of would be the reader missing the change in date as the last criterion selected item rolls into the rest of the news archive. Perhaps adding an <h*> separator header, 'Older Articles' or something like that, after the selected criterion articles are finished.

News categories block: that second fix you posted has solved the issue, thanx!   :thumbs: I'm still not seeing the categories that have no entries (added a new empty category to double check), however, not sure that's a big deal IMHO. I wouldn't have noticed it had I not been reviewing the database for troubleshooting purposes and the empty categories are available for selection on the new news entry screen which is the important bit anyway.

v11 themeing: righto, I'll finish puttering away on the one I've been working on for the v10 structure and then hang tight.

Welcome to North America! :) Hopefully things settle quickly for you so you can begin enjoying this next chapter in your life.

Separating forum items: understood, makes perfect sense, will do!

Post

Posted
Rating:
#4996
I'm still not seeing the categories that have no entries (added a new empty category to double check)

Yes, that's intentional. You'll only see empty categories if all categories are empty.

Thanks :) .

Post

Posted
Rating:
#4997
Lol, yeah, I'm gettin' old: totally misread the commented section to say if a category, not all categories had no entries show them anyway.

Interestingly, this comment only appears in v10.0.21 but only in my local installation and not the one I test with on my hosting account, however they have not been upgraded in tandem over time. Also explains why my line numbers were 2 out of sync with the changes you provided for this block. Oh well, not important and perhaps time for some new glasses for me ;)

Thanx again!

side_news_categories lines 87-97

Code


        // Oh, no categories with any entries - so show them regardless of entries
        if (count($categories) == 0) {
            foreach ($_categories as $category) {
                if (has_category_access(get_member(), 'news', strval($category['id']))) {
                    $category['_nc_title'] = get_translated_text($category['nc_title']);
                    //$categories[] = array($category, $count);
                    $categories[] = array($category, $count, $category['_nc_title']);
                }
            }
        }

Edit: *chuckle*, I was beginning to question my sanity again so went back to GIT and here's where the comment came from as I just cut and pasted the entire section in. Mystery solved, some melon marbles still intact :)

140 views (29 KB)

Last edit: by SoccerDad


Post

Posted
Rating:
#4998
Right, I actually just added the comment when working on the code for this topic. Sometimes I'll do that, see old code that isn't entirely clear, and rework it a little.

Post

Posted
Rating:
#4999
  :thumbs:   :)

1 guest and 0 members have recently viewed this.